# Path: XulDebugTool/utils/ConsoleStreamEmittor.py
# class ConsoleEmittor(QObject):
#     textWritten = pyqtSignal(str)
# 
#     def write(self, text):
#         self.textWritten.emit(str(text))
# 
# Path: XulDebugTool/utils/IconTool.py
# class IconTool(object):
#     def __init__(self):
#         super().__init__()
# 
#     def buildQIcon(iconName):
#         return QIcon(os.path.join('..', 'resources', 'images', iconName))
# 
#     def buildQPixmap(pixmapName):
#         return QPixmap(os.path.join('..', 'resources', 'images', pixmapName))


import sys
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QIcon, QTextCursor
from PyQt5.QtWidgets import QMainWindow, QAction, \
    QSplitter, QApplication, QWidget, QHBoxLayout, QComboBox, QPushButton, \
    QLineEdit, QSizePolicy, QVBoxLayout, QTextBrowser
from XulDebugTool.utils.ConsoleStreamEmittor import ConsoleEmittor
from XulDebugTool.utils.IconTool import IconTool
        super(ConsoleWindow, self).__init__(parent)
        self.isConUrl = False

        # 上
        self.searchButton = QLineEdit()
        self.searchButton.setPlaceholderText("搜索")
        self.searchButton.setMaximumWidth(300)
        self.searchButton.setMaximumHeight(32)
        self.searchButton.setSizePolicy(QSizePolicy.Maximum, QSizePolicy.Minimum)

        self.combo = QComboBox(self);
        self.combo.insertItem(0, 'Error');
        self.combo.insertItem(1, 'Debug');
        self.combo.insertItem(2, 'Verbose');
        self.combo.insertItem(3, 'Warning');
        self.combo.setCurrentIndex(0)

        layout_top = QHBoxLayout()
        layout_top.setAlignment(Qt.AlignRight)
        layout_top.setSpacing(20)
        # layout_top.addWidget(self.combo)
        # layout_top.addWidget(self.searchButton)

        self.functionTabWiget = QWidget()
        self.functionTabWiget.setAutoFillBackground(True)
        self.functionTabWiget.setFixedHeight(20)
        self.functionTabWiget.setLayout(layout_top)

        # 左
        self.clearButton = QPushButton(self)

# Path: XulDebugTool/utils/ConsoleStreamEmittor.py
# class ConsoleEmittor(QObject):
#     textWritten = pyqtSignal(str)
# 
#     def write(self, text):
#         self.textWritten.emit(str(text))
# 
# Path: XulDebugTool/utils/IconTool.py
# class IconTool(object):
#     def __init__(self):
#         super().__init__()
# 
#     def buildQIcon(iconName):
#         return QIcon(os.path.join('..', 'resources', 'images', iconName))
# 
#     def buildQPixmap(pixmapName):
#         return QPixmap(os.path.join('..', 'resources', 'images', pixmapName))


# Path: XulDebugTool/ui/widget/ConsoleView.py
import sys
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QIcon, QTextCursor
from PyQt5.QtWidgets import QMainWindow, QAction, \
    QSplitter, QApplication, QWidget, QHBoxLayout, QComboBox, QPushButton, \
    QLineEdit, QSizePolicy, QVBoxLayout, QTextBrowser
from XulDebugTool.utils.ConsoleStreamEmittor import ConsoleEmittor
from XulDebugTool.utils.IconTool import IconTool

        super(ConsoleWindow, self).__init__(parent)
        self.isConUrl = False

        # 上
        self.searchButton = QLineEdit()
        self.searchButton.setPlaceholderText("搜索")
        self.searchButton.setMaximumWidth(300)
        self.searchButton.setMaximumHeight(32)
        self.searchButton.setSizePolicy(QSizePolicy.Maximum, QSizePolicy.Minimum)

        self.combo = QComboBox(self);
        self.combo.insertItem(0, 'Error');
        self.combo.insertItem(1, 'Debug');
        self.combo.insertItem(2, 'Verbose');
        self.combo.insertItem(3, 'Warning');
        self.combo.setCurrentIndex(0)

        layout_top = QHBoxLayout()
        layout_top.setAlignment(Qt.AlignRight)
        layout_top.setSpacing(20)
        # layout_top.addWidget(self.combo)
        # layout_top.addWidget(self.searchButton)

        self.functionTabWiget = QWidget()
        self.functionTabWiget.setAutoFillBackground(True)
        self.functionTabWiget.setFixedHeight(20)
        self.functionTabWiget.setLayout(layout_top)

        # 左
        self.clearButton = QPushButton(self)

        icon = QIcon(IconTool.buildQIcon('clear.png'))