예제 #1
0
 def drawImagePoints(self):
     '''
     Redraws the points on the display.
     '''
     
     # We don't want to actually draw the points onto the image, because then we'd have to reload the
     # image from disk to undo the changes. Instead, we work on a copy, and only display the copy.
     # The original image remains unchanged in memory.
     newImage = self.originalImage.toImage()
     
     for p in self.coordList.points:
         top = int((p.y-0.4) * self.scaleFactor)
         bottom = int((p.y+0.4) * self.scaleFactor)
         left = int((p.x-0.4) * self.scaleFactor)
         right = int((p.x+0.4) * self.scaleFactor)
         if p.colour == 0:
             colour = QtGui.qRgb(0, 255, 0)
         else:
             colour = QtGui.qRgb(255, 0, 0)
         borderColour = QtGui.qRgb(0, 0, 0)
         for x in range(left, right+1):
             for y in range(top, bottom+1):
                 if x>0 and x<newImage.width() and y>0 and y<newImage.height():    
                     newImage.setPixel(x, y, colour)
         for x in range(left-1, right+2):
             for y in [top-1, bottom+1]:    
                 if x>0 and x<newImage.width() and y>0 and y<newImage.height():    
                     newImage.setPixel(x, y, borderColour)
         for x in [left-1, right+1]:
             for y in range(top-1, bottom+2):    
                 if x>0 and x<newImage.width() and y>0 and y<newImage.height():    
                     newImage.setPixel(x, y, borderColour)
         
     self.image.convertFromImage(newImage)
     self.imageBlockScene.update()
예제 #2
0
 def setColorTable(self):
     if self.colortable:
         for i in range(256):
             self.image.setColor(i, QtGui.qRgb(self.colortable[i][0], self.colortable[i][1], self.colortable[i][2]))
     else:
         for i in range(256):
             self.image.setColor(i, QtGui.qRgb(i, i, i))
예제 #3
0
    def frameAsQImage(self):
        h = self.frame_copy.height
        w = self.frame_copy.width
        channels = self.frame_copy.nChannels
        qimg = QtGui.QImage(w, h, QtGui.QImage.Format_ARGB32)
        data = self.frame_copy.tostring()

        for y in range(0, h):
            for x in range(0, w):
                r, g, b, a = 0
                if channels == 1:
                    r = data[x * channels]
                    g = data[x * channels]
                    b = data[x * channels]
                elif channels == 3 or channels == 4:
                    r = data[x * channels + 2]
                    g = data[x * channels + 1]
                    b = data[x * channels]
                if channels == 4:
                    a = data[x * channels + 3]
                    qimg.setPixel(x, y, QtGui.qRgba(r, g, b, a))
                else:
                    qimg.setPixel(x, y, QtGui.qRgb(r, g, b))
            data += self.frame_copy.widthStep
        return qimg
예제 #4
0
	def sendColors(self, colors):
		kod = chr(128) #kod inicjujacy poczatek standardowej paczki + konfig
		global sum
		sum = 0
		self.addSum(128) #suma kontrolna tj. suma wszystkich wartosci, skrocona do 7 bitow (bajt podzielony przez dwa)
		for color in colors:
			red = float(QtGui.qRed(color))/255
			green = float(QtGui.qGreen(color))/255
			blue = float(QtGui.qBlue(color))/255
			verbose("k: %d" % (colors.index(color)+1), 3)
			verbose("\trgb: %f, %f, %f" % (red, green, blue), 3)
			red = int(red*red*100)
			green = int(green*green*100)
			blue = int(blue*blue*100)
			verbose("\t\trgb: %f, %f, %f" % (red, green, blue), 3)
			kod += chr(red)
			kod += chr(green)
			kod += chr(blue)
			self.addSum(red)
			self.addSum(green)
			self.addSum(blue)
		kod += chr(sum/2)
		try:
			ser.write(kod)
		except:
			verbose("--\nCannot send to device. Check your configuration!",1)
		time.sleep(0.009) # hack needed by hardware
예제 #5
0
 def createAreaView(self):
     (width, height) = (self.areaView.width(), self.areaView.height())
     img = QtGui.QImage(width, height, QtGui.QImage.Format_ARGB32)
     img.fill(QtGui.qRgba(236, 236, 236, 255))
     self.areaViewPoints = []
     yshift = width / 4  # so that 255 and 0 can be easily targeted
     for i, area in enumerate(self.areas):
         if not area:
             continue
         if i == self.indexArea:
             color = QtGui.qRgba(255, 150, 150, 255)
         else:
             color = QtGui.qRgba(0, 0, 0, 255)
         mid = int(float(height - 2 * yshift) * (1. - float(area[2]) / 255.)) + yshift
         lst = []
         for x in xrange(0, width):
             dy = (width - x) / 4
             for y in xrange((mid - dy), (mid + dy)):
                 if not (0 < x < width and 0 < y < height):
                     continue
                 img.setPixel(x, y, color)
                 lst.append([x, y])
         self.areaViewPoints.append(lst)
     scene = QtGui.QGraphicsScene()
     scene.setSceneRect(0, 0, width, height)
     pic = QtGui.QPixmap.fromImage(img)
     scene.addItem(QtGui.QGraphicsPixmapItem(pic))
     self.areaView.setScene(scene)
     self.areaView.setRenderHint(QtGui.QPainter.Antialiasing)
     self.areaView.show()
     del img
예제 #6
0
 def cal_img(self,pointX,pointY):
     img = QPixmap.grabWindow(
         QApplication.desktop().winId()).toImage()
     rgb = img.pixel(pointX, pointY)
     red10 = QtGui.qRed(rgb)
     green10 =QtGui.qGreen(rgb)
     blue10 = QtGui.qBlue(rgb)
     print pointX, pointY,red10,green10,blue10
예제 #7
0
    def grayScale(self, image):
        for i in range(self.w):
            for j in range(self.h):
                c = image.pixel(i, j)
                gray = QtGui.qGray(c)
                alpha = QtGui.qAlpha(c)
                image.setPixel(i, j, QtGui.qRgba(gray, gray, gray, alpha))

        return image
예제 #8
0
def gray2qimage(gray, normalize = False):
    """Convert the 2D numpy array `gray` into a 8-bit, indexed QImage_
    with a gray colormap.  The first dimension represents the vertical
    image axis.

    The parameter `normalize` can be used to normalize an image's
    value range to 0..255:

    `normalize` = (nmin, nmax):
      scale & clip image values from nmin..nmax to 0..255

    `normalize` = nmax:
      lets nmin default to zero, i.e. scale & clip the range 0..nmax
      to 0..255

    `normalize` = True:
      scale image values to 0..255 (same as passing (gray.min(),
      gray.max()))

    If the source array `gray` contains masked values, the result will
    have only 255 shades of gray, and one color map entry will be used
    to make the corresponding pixels transparent.

    A full alpha channel cannot be supported with indexed images;
    instead, use `array2qimage` to convert into a 32-bit QImage.

    :param gray: image data which should be converted (copied) into a QImage_
    :type gray: 2D or 3D numpy.ndarray_ or `numpy.ma.array <masked arrays>`_
    :param normalize: normalization parameter (see above, default: no value changing)
    :type normalize: bool, scalar, or pair
    :rtype: QImage_ with RGB32 or ARGB32 format"""
    if _np.ndim(gray) != 2:
        raise ValueError("gray2QImage can only convert 2D arrays" +
                         " (try using array2qimage)" if _np.ndim(gray) == 3 else "")

    h, w = gray.shape
    result = _qt.QImage(w, h, _qt.QImage.Format_Indexed8)

    if not _np.ma.is_masked(gray):
        for i in range(256):
            result.setColor(i, _qt.qRgb(i,i,i))

        _qimageview(result)[:] = _normalize255(gray, normalize)
    else:
        # map gray value 1 to gray value 0, in order to make room for
        # transparent colormap entry:
        result.setColor(0, _qt.qRgb(0,0,0))
        for i in range(2, 256):
            result.setColor(i-1, _qt.qRgb(i,i,i))

        _qimageview(result)[:] = _normalize255(gray, normalize, clip = (1, 255)) - 1

        result.setColor(255, 0)
        _qimageview(result)[gray.mask] = 255

    return result
예제 #9
0
파일: TrayIcon.py 프로젝트: Lagg3r/emesene
 def set_login(self):    # emesene's
     '''Called when the login window is shown. Sets a proper
     context menu un the Tray Icon.'''
     tray_login_menu_cls = extension.get_default('tray login menu')
     self._menu = tray_login_menu_cls(self._handler)
     self.setIcon(QtGui.QIcon(gui.theme.get_image_theme().logo))
     if sys.platform == 'darwin':
         QtGui.qt_mac_set_dock_menu(self._menu)
     else:
         self.setContextMenu(self._menu)
예제 #10
0
def QPixmapToIplImage( pixmap ):
    pixmap = pixmap.toImage()
    width = pixmap.width();
    height = pixmap.height()
    size = (width, height)
    IplImageBuffer = cv.CreateImage(size, 8, 3)
    for y in range(0, height):
        for x in range(0, width):
            rgb = pixmap.pixel(x, y)
            cv.Set2D(IplImageBuffer, y, x, cv.CV_RGB(QtGui.qRed(rgb), QtGui.qGreen(rgb), QtGui.qBlue(rgb)))
    return IplImageBuffer;
예제 #11
0
파일: TrayIcon.py 프로젝트: AmiZya/emesene
 def set_login(self):
     '''Called when the login window is shown. Sets a proper
     context menu in the Tray Icon.'''
     tray_login_menu_cls = extension.get_default('tray login menu')
     self.menu = tray_login_menu_cls(self.handler, self._main_window)
     self.setIcon(QtGui.QIcon(gui.theme.image_theme.logo_panel))
     self.setToolTip("emesene")
     if sys.platform == 'darwin':
         QtGui.qt_mac_set_dock_menu(self.menu)
     else:
         self.setContextMenu(self.menu)
예제 #12
0
파일: texview.py 프로젝트: fielder/fenton
def _loadSimpleTexture(fp):
    fp.seek(0, 2)
    fsize = fp.tell()
    fp.seek(0)

    if fsize <= 8:
        raise ValueError("not an image")

    width, = struct.unpack("<I", fp.read(4))
    height, = struct.unpack("<I", fp.read(4))
    if width <= 0 or width > 1024 or height <= 0 or height > 1024:
        raise ValueError("invalid size %dx%d" % (width, height))

    if fsize != 8 + (width * height * 3):
        if fsize != 8 + (width * height * 3) + (width * height):
            raise ValueError("invalid file size %d" % fsize)

    pixeldat = fp.read(width * height * 3)

    if fp.tell() == fsize:
        pixels = [ QtGui.qRgb(ord(pixeldat[i + 0]), \
                              ord(pixeldat[i + 1]), \
                              ord(pixeldat[i + 2])) for i in xrange(0, len(pixeldat), 3) ]
        masked = False
    else:
        maskdat = fp.read(width * height)
        pixels = []
        for idx in xrange(width * height):
            if maskdat[idx] != "\x00":
                rgba = QtGui.qRgba(ord(pixeldat[idx * 3 + 0]), \
                                   ord(pixeldat[idx * 3 + 1]), \
                                   ord(pixeldat[idx * 3 + 2]), \
                                   255)
            else:
                rgba = QtGui.qRgba(0, 0, 0, 0)
            pixels.append(rgba)
        masked = True

    levels = []

    lev = Level()
    lev.width = width
    lev.height = height
    lev.pixels = pixels
    levels.append(lev)

    ret = Texture()
    ret.name = "none"
    ret.original_width = width
    ret.original_height = height
    ret.masked = bool(masked)
    ret.levels = levels

    return ret
예제 #13
0
 def set_main(self, session):
     """Called when the main window is shown. Stores the contact list
     and registers the callback for the status_change_succeed event"""
     self._handler.session = session
     self._handler.session.signals.status_change_succeed.subscribe(self._on_status_changed)
     tray_main_menu_cls = extension.get_default("tray main menu")
     self._menu = tray_main_menu_cls(self._handler)
     if sys.platform == "darwin":
         QtGui.qt_mac_set_dock_menu(self._menu)
     else:
         self.setContextMenu(self._menu)
def test_scalar2qimage():
    a = numpy.zeros((240, 320), dtype = float)
    a[12,10] = 42.42
    a[13,10] = -10
    qImg = qimage2ndarray.array2qimage(a)
    assert not qImg.isNull()
    assert_equal(qImg.width(), 320)
    assert_equal(qImg.height(), 240)
    assert_equal(qImg.format(), QtGui.QImage.Format_RGB32)
    assert_equal(hex(qImg.pixel(10,12)), hex(QtGui.qRgb(42,42,42))) # max pixel
    assert_equal(hex(qImg.pixel(10,14)), hex(QtGui.qRgb(0,0,0)))    # zero pixel
    assert_equal(hex(qImg.pixel(10,13)), hex(QtGui.qRgb(0,0,0)))    # min pixel
def test_rgb2qimage():
    a = numpy.zeros((240, 320, 3), dtype = float)
    a[12,10] = (42.42, 20, 14)
    a[13,10] = (-10, 0, -14)
    qImg = qimage2ndarray.array2qimage(a)
    assert not qImg.isNull()
    assert_equal(qImg.width(), 320)
    assert_equal(qImg.height(), 240)
    assert_equal(qImg.format(), QtGui.QImage.Format_RGB32)
    assert_equal(hex(qImg.pixel(10,12)), hex(QtGui.qRgb(42,20,14)))
    assert_equal(hex(qImg.pixel(10,13)), hex(QtGui.qRgb(0,0,0)))
    assert_equal(hex(qImg.pixel(10,14)), hex(QtGui.qRgb(0,0,0)))
예제 #16
0
def to_grayscaled(path):
    origin = QtGui.QPixmap(path)

    img = origin.toImage()
    for i in xrange(origin.width()):
        for j in xrange(origin.height()):
            col = img.pixel(i, j)
            gray = QtGui.qGray(col)
            img.setPixel(i, j, QtGui.qRgb(gray, gray, gray))

    dst = origin.fromImage(img)
    return dst
예제 #17
0
파일: pixeditor.py 프로젝트: z-uo/pixeditor
 def minimizePaletteAction(self):
     self.project.saveToUndo("colorTable_frames")
     usedColorsIndices = self.project.getUsedColorList()
     newPalette = [self.project.colorTable[i] for i in usedColorsIndices]
     if QtGui.qRgba(0, 0, 0, 0) in newPalette:
         newPalette.remove(QtGui.qRgba(0, 0, 0, 0))
     newPalette.insert(0, QtGui.qRgba(0, 0, 0, 0))
     self.project.changeColorTable(newPalette)
     self.project.color = 1
     self.project.currentColor = 1
     self.project.updateViewSign.emit()
     self.project.updatePaletteSign.emit()
     self.project.colorChangedSign.emit()
def test_scalar2qimage_with_alpha():
    a = numpy.zeros((240, 320, 2), dtype = float)
    a[...,1] = 255
    a[12,10] = (42.42, 128)
    a[13,10] = (-10, 0)
    qImg = qimage2ndarray.array2qimage(a)
    assert not qImg.isNull()
    assert_equal(qImg.width(), 320)
    assert_equal(qImg.height(), 240)
    assert_equal(qImg.format(), QtGui.QImage.Format_ARGB32)
    assert_equal(hex(qImg.pixel(10,12)), hex(QtGui.qRgba(42,42,42,128))) # max pixel
    assert_equal(hex(qImg.pixel(10,14)), hex(QtGui.qRgba(0,0,0,255)))    # zero pixel
    assert_equal(hex(qImg.pixel(10,13)), hex(QtGui.qRgba(0,0,0,0)))      # min pixel
def test_gray2qimage():
    a = numpy.zeros((240, 320), dtype = float)
    a[12,10] = 42.42
    a[13,10] = -10
    qImg = qimage2ndarray.gray2qimage(a)
    assert not qImg.isNull()
    assert_equal(qImg.width(), 320)
    assert_equal(qImg.height(), 240)
    assert_equal(qImg.format(), QtGui.QImage.Format_Indexed8)
    assert_equal(a.nbytes, qImg.numBytes() * a.itemsize)
    assert_equal(qImg.numColors(), 256)
    assert_equal(hex(qImg.pixel(10,12)), hex(QtGui.qRgb(42,42,42)))
    assert_equal(hex(qImg.pixel(10,14)), hex(QtGui.qRgb(0,0,0)))
    assert_equal(hex(qImg.pixel(10,13)), hex(QtGui.qRgb(0,0,0)))
예제 #20
0
파일: TrayIcon.py 프로젝트: AmiZya/emesene
 def set_main(self, session):
     '''Called when the main window is shown. Stores the contact list
     and registers the callback for the status_change_succeed event'''
     gui.BaseTray.set_main(self, session)
     if self.menu:
         self.menu.unsubscribe()
     tray_main_menu_cls = extension.get_default('tray main menu')
     self.menu = tray_main_menu_cls(self.handler, self._main_window)
     self.setToolTip("emesene - " + self.handler.session.account.account)
     self._on_status_change_succeed(self.handler.session.account.status)
     if sys.platform == 'darwin':
         QtGui.qt_mac_set_dock_menu(self.menu)
     else:
         self.setContextMenu(self.menu)
예제 #21
0
def createlineimage(image):
    print "Creating line image"
    for y in range(image.height()):
        max_value = 0
        max_position = 0
        for x in range(image.width()):
            pixel = image.pixel(x,y)
            if QtGui.qRed(pixel) > max_value:
                max_value = QtGui.qRed(pixel)
                max_position = x
            pixel = QtGui.qRgb(0,0,0)
            image.setPixel(x,y,pixel)
        pixel = QtGui.qRgb(max_value,0,0)
        image.setPixel(max_position,y,pixel)
def to_gray(image):
  out = QImage(image.width(), image.height(), QImage.Format_Indexed8)
  color_table = []
  
  for i in range(256):
    color_table.append(QtGui.qRgb(i, i, i))
  
  out.setColorTable(color_table)
  
  for i in range(image.width()):
    for j in range(image.height()):
      color = image.pixel(i, j)
      out.setPixel(i, j, QtGui.qGray(color))
  
  return out
def test_scalar2qimage_normalize_domain():
    a = numpy.zeros((240, 320), dtype = float)
    a[12,10] = 42.42
    a[13,10] = -10
    qImg = qimage2ndarray.array2qimage(a, normalize = (-100, 100))
    assert not qImg.isNull()
    assert_equal(qImg.width(), 320)
    assert_equal(qImg.height(), 240)
    assert_equal(qImg.format(), QtGui.QImage.Format_RGB32)
    x = int(255 * 142.42 / 200.0)
    assert_equal(hex(qImg.pixel(10,12)), hex(QtGui.qRgb(x,x,x)))
    x = int(255 *  90.0 / 200.0)
    assert_equal(hex(qImg.pixel(10,13)), hex(QtGui.qRgb(x,x,x)))
    x = int(255 * 100.0 / 200.0)
    assert_equal(hex(qImg.pixel(10,14)), hex(QtGui.qRgb(x,x,x)))
 def on_doneOverlaysAvailable(self):
     s = self.ilastik._activeImage.Interactive_Segmentation
     
     bluetable    = [QtGui.qRgb(0, 0, 255) for i in range(256)]
     bluetable[0] = long(0) #transparency
     
     randomColorTable    = [QtGui.qRgb(random.randint(0,255),random.randint(0,255),random.randint(0,255)) for i in range(256)] 
     randomColorTable[0] = long(0) #transparency
     
     self.doneBinaryOverlay = OverlayItem(s.done, color = 0, colorTable=bluetable, alpha = 0.5, autoAdd = True, autoVisible = True, min = 0, max = 255)
     self.ilastik._activeImage.overlayMgr["Segmentation/Done"] = self.doneBinaryOverlay
     self.doneObjectsOverlay = OverlayItem(s.done, color=0, colorTable=randomColorTable, alpha=0.7, autoAdd=False, autoVisible=False, min = 0, max = 255)
     self.ilastik._activeImage.overlayMgr["Segmentation/Objects"] = self.doneObjectsOverlay
     
     self.overlayWidget.addOverlayRef(self.doneBinaryOverlay.getRef())
def test_rgb2qimage_normalize():
    a = numpy.zeros((240, 320, 3), dtype = float)
    a[12,10] = (42.42, 20, 14)
    a[13,10] = (-10, 20, 0)
    qImg = qimage2ndarray.array2qimage(a, normalize = True)
    assert not qImg.isNull()
    assert_equal(qImg.width(), 320)
    assert_equal(qImg.height(), 240)
    assert_equal(qImg.format(), QtGui.QImage.Format_RGB32)
    assert_equal(hex(qImg.pixel(10,12)),
                 hex(QtGui.qRgb(255,(255*30.0/52.42),(255*24/52.42))))
    assert_equal(hex(qImg.pixel(10,13)),
                 hex(QtGui.qRgb(0,(255*30.0/52.42),(255*10/52.42))))
    x = int(255 * 10.0 / 52.42)
    assert_equal(hex(qImg.pixel(10,14)), hex(QtGui.qRgb(x,x,x)))       # zero pixel
예제 #26
0
    def fill_picture_per_pixel(self):
        bitmap_info = self.bmp.get_bitmap_info()
        pixel_data = self.bmp.get_pixel_data()

        width = bitmap_info.get_width().get_unpack_value()
        height = bitmap_info.get_height().get_unpack_value()
        pixel_colors_generator = pixel_data.get_pixel_color()
        addition = pixel_data.get_addition()

        image = QtGui.QImage(width, abs(height), QtGui.QImage.Format_RGB32)
        if height < 0:
            try:
                for i in range(abs(height)):
                    for j in range(width):
                        color = next(pixel_colors_generator)
                        image.setPixel(
                            j, i, QtGui.qRgb(color[2], color[1], color[0]))
                    for a in range(addition):
                        next(pixel_colors_generator)
            except StopIteration:
                for i in range(abs(height)):
                    for j in range(width):
                        color = next(pixel_colors_generator)
                        image.setPixel(
                            j, i, QtGui.qRgb(color[2], color[1], color[0]))
        try:
            for i in range(height-1, -1, -1):
                for j in range(width):
                    color = next(pixel_colors_generator)
                    image.setPixel(
                        j, i, QtGui.qRgb(color[2], color[1], color[0]))
                for a in range(addition):
                    next(pixel_colors_generator)
        except StopIteration:
            pixel_colors_generator = pixel_data.get_pixel_color()
            for i in range(height-1, -1, -1):
                for j in range(width):
                    color = next(pixel_colors_generator)
                    image.setPixel(
                        j, i, QtGui.qRgb(color[2], color[1], color[0]))

        pix_map = QtGui.QPixmap()
        pix_map.convertFromImage(image)
        pix_map = pix_map.scaled(600, 600, 1)
        pic = QtGui.QLabel()
        pic.setPixmap(pix_map)

        self.grid.addWidget(pic, 0, 1)
예제 #27
0
    def rgbFromWaveLength(self, wave):
        r = 0.0
        g = 0.0
        b = 0.0

        if wave >= 380.0 and wave <= 440.0:
            r = -1.0 * (wave - 440.0) / (440.0 - 380.0)
            b = 1.0
        elif wave >= 440.0 and wave <= 490.0:
            g = (wave - 440.0) / (490.0 - 440.0)
            b = 1.0
        elif wave >= 490.0 and wave <= 510.0:
            g = 1.0
            b = -1.0 * (wave - 510.0) / (510.0 - 490.0)
        elif wave >= 510.0 and wave <= 580.0:
            r = (wave - 510.0) / (580.0 - 510.0)
            g = 1.0
        elif wave >= 580.0 and wave <= 645.0:
            r = 1.0
            g = -1.0 * (wave - 645.0) / (645.0 - 580.0)
        elif wave >= 645.0 and wave <= 780.0:
            r = 1.0

        s = 1.0
        if wave > 700.0:
            s = 0.3 + 0.7 * (780.0 - wave) / (780.0 - 700.0)
        elif wave < 420.0:
            s = 0.3 + 0.7 * (wave - 380.0) / (420.0 - 380.0)

        r = pow(r * s, 0.8)
        g = pow(g * s, 0.8)
        b = pow(b * s, 0.8)

        return QtGui.qRgb(r*255, g*255, b*255)
예제 #28
0
파일: stack1.py 프로젝트: misterbonnie/bbqt
    def resizeImage(self, image, newSize):
        if image.size() == newSize:
            return

#       print "image.size() = %s" % repr(image.size())
#       print "newSize = %s" % newSize

# this resizes the canvas without resampling the image
        newImage = QtGui.QImage(newSize, QtGui.QImage.Format_RGB32)
        newImage.fill(QtGui.qRgb(255, 255, 255))
        painter = QtGui.QPainter(newImage)
        painter.drawImage(QtCore.QPoint(0, 0), image)


##  this resampled the image but it gets messed up with so many events...       
##      painter.setRenderHint(QtGui.QPainter.SmoothPixmapTransform, True)
##      painter.setRenderHint(QtGui.QPainter.HighQualityAntialiasing, True)
#       
#       newImage = QtGui.QImage(newSize, QtGui.QImage.Format_RGB32)
#       newImage.fill(QtGui.qRgb(255, 255, 255))
#       painter = QtGui.QPainter(newImage)
#       srcRect = QtCore.QRect(QtCore.QPoint(0,0), image.size())
#       dstRect = QtCore.QRect(QtCore.QPoint(0,0), newSize)
##      print "srcRect = %s" % srcRect
##      print "dstRect = %s" % dstRect
#       painter.drawImage(dstRect, image, srcRect)


        self.image = newImage
예제 #29
0
    def __init__(self, text, parent):
        super(DragLabel, self).__init__(parent)

        metric = QtGui.QFontMetrics(self.font())
        size = metric.size(QtCore.Qt.TextSingleLine, text)

        image = QtGui.QImage(size.width() + 12, size.height() + 12,
                QtGui.QImage.Format_ARGB32_Premultiplied)
        image.fill(QtGui.qRgba(0, 0, 0, 0))

        font = QtGui.QFont()
        font.setStyleStrategy(QtGui.QFont.ForceOutline)

        painter = QtGui.QPainter()
        painter.begin(image)
        painter.setRenderHint(QtGui.QPainter.Antialiasing)
        painter.setBrush(QtCore.Qt.white)
        painter.drawRoundedRect(QtCore.QRectF(0.5, 0.5, image.width()-1,
                image.height()-1), 25, 25, QtCore.Qt.RelativeSize)

        painter.setFont(font)
        painter.setBrush(QtCore.Qt.black)
        painter.drawText(QtCore.QRect(QtCore.QPoint(6, 6), size),
                QtCore.Qt.AlignCenter, text)
        painter.end()

        self.setPixmap(QtGui.QPixmap.fromImage(image))
        self.labelText = text
예제 #30
0
파일: pnpcntrl.py 프로젝트: pdp7/bbqt
 def __init__(self, *args):
     super(Painting, self).__init__()
     imageSize = QtCore.QSize(300, 300)
     self.image = QtGui.QImage(imageSize, QtGui.QImage.Format_RGB32)
     self.lastPoint = QtCore.QPoint()
     self.currentPos = QPoint(0,0)
     self.image.fill(QtGui.qRgb(255, 255, 255))
예제 #31
0
파일: pyqt4.py 프로젝트: stayhigh/CS-notes
import sys
from PyQt4 import QtCore, QtGui

app = QtGui.QApplication(sys.argv)

widget = QtGui.QWidget()
widget.resize(250, 250)
widget.setWindowTitle("Test")
widget.show()

sys.exit(app.exec_())
    def setupUi(self, PopulationStructureDetailedSetup):
        PopulationStructureDetailedSetup.setObjectName(
            _fromUtf8("PopulationStructureDetailedSetup"))
        PopulationStructureDetailedSetup.resize(624, 468)
        self.gridLayout = QtGui.QGridLayout(PopulationStructureDetailedSetup)
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        self.lblDate = QtGui.QLabel(PopulationStructureDetailedSetup)
        self.lblDate.setAlignment(QtCore.Qt.AlignRight
                                  | QtCore.Qt.AlignTrailing
                                  | QtCore.Qt.AlignVCenter)
        self.lblDate.setObjectName(_fromUtf8("lblDate"))
        self.gridLayout.addWidget(self.lblDate, 0, 0, 1, 1)
        self.edtDate = CDateEdit(PopulationStructureDetailedSetup)
        self.edtDate.setObjectName(_fromUtf8("edtDate"))
        self.gridLayout.addWidget(self.edtDate, 0, 1, 1, 1)
        self.lblAge = QtGui.QLabel(PopulationStructureDetailedSetup)
        self.lblAge.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing
                                 | QtCore.Qt.AlignVCenter)
        self.lblAge.setObjectName(_fromUtf8("lblAge"))
        self.gridLayout.addWidget(self.lblAge, 1, 0, 1, 1)
        self.grpAge = QtGui.QHBoxLayout()
        self.grpAge.setSizeConstraint(QtGui.QLayout.SetDefaultConstraint)
        self.grpAge.setSpacing(6)
        self.grpAge.setObjectName(_fromUtf8("grpAge"))
        self.edtAgeStart = QtGui.QSpinBox(PopulationStructureDetailedSetup)
        self.edtAgeStart.setObjectName(_fromUtf8("edtAgeStart"))
        self.grpAge.addWidget(self.edtAgeStart)
        self.lblAgeRange = QtGui.QLabel(PopulationStructureDetailedSetup)
        self.lblAgeRange.setObjectName(_fromUtf8("lblAgeRange"))
        self.grpAge.addWidget(self.lblAgeRange)
        self.edtAgeEnd = QtGui.QSpinBox(PopulationStructureDetailedSetup)
        self.edtAgeEnd.setMinimum(0)
        self.edtAgeEnd.setMaximum(200)
        self.edtAgeEnd.setProperty("value", 150)
        self.edtAgeEnd.setObjectName(_fromUtf8("edtAgeEnd"))
        self.grpAge.addWidget(self.edtAgeEnd)
        spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding,
                                       QtGui.QSizePolicy.Minimum)
        self.grpAge.addItem(spacerItem)
        self.gridLayout.addLayout(self.grpAge, 1, 1, 1, 1)
        self.lblSocStatusClass = QtGui.QLabel(PopulationStructureDetailedSetup)
        self.lblSocStatusClass.setAlignment(QtCore.Qt.AlignRight
                                            | QtCore.Qt.AlignTrailing
                                            | QtCore.Qt.AlignVCenter)
        self.lblSocStatusClass.setObjectName(_fromUtf8("lblSocStatusClass"))
        self.gridLayout.addWidget(self.lblSocStatusClass, 2, 0, 1, 1)
        self.cmbSocStatusClass = CSocStatusComboBox(
            PopulationStructureDetailedSetup)
        self.cmbSocStatusClass.setObjectName(_fromUtf8("cmbSocStatusClass"))
        self.gridLayout.addWidget(self.cmbSocStatusClass, 2, 1, 1, 1)
        self.lblSocStatusType = QtGui.QLabel(PopulationStructureDetailedSetup)
        self.lblSocStatusType.setAlignment(QtCore.Qt.AlignRight
                                           | QtCore.Qt.AlignTrailing
                                           | QtCore.Qt.AlignVCenter)
        self.lblSocStatusType.setObjectName(_fromUtf8("lblSocStatusType"))
        self.gridLayout.addWidget(self.lblSocStatusType, 3, 0, 1, 1)
        self.cmbSocStatusType = CRBComboBox(PopulationStructureDetailedSetup)
        self.cmbSocStatusType.setObjectName(_fromUtf8("cmbSocStatusType"))
        self.gridLayout.addWidget(self.cmbSocStatusType, 3, 1, 1, 1)
        self.lblOrgStructure = QtGui.QLabel(PopulationStructureDetailedSetup)
        self.lblOrgStructure.setAlignment(QtCore.Qt.AlignRight
                                          | QtCore.Qt.AlignTrailing
                                          | QtCore.Qt.AlignVCenter)
        self.lblOrgStructure.setObjectName(_fromUtf8("lblOrgStructure"))
        self.gridLayout.addWidget(self.lblOrgStructure, 4, 0, 1, 1)
        self.cmbOrgStructure = COrgStructureComboBox(
            PopulationStructureDetailedSetup)
        self.cmbOrgStructure.setObjectName(_fromUtf8("cmbOrgStructure"))
        self.gridLayout.addWidget(self.cmbOrgStructure, 4, 1, 1, 1)
        self.label = QtGui.QLabel(PopulationStructureDetailedSetup)
        self.label.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTop
                                | QtCore.Qt.AlignTrailing)
        self.label.setObjectName(_fromUtf8("label"))
        self.gridLayout.addWidget(self.label, 5, 0, 1, 1)
        self.buttonBox = QtGui.QDialogButtonBox(
            PopulationStructureDetailedSetup)
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel
                                          | QtGui.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
        self.gridLayout.addWidget(self.buttonBox, 7, 0, 1, 2)
        self.splitter = QtGui.QSplitter(PopulationStructureDetailedSetup)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,
                                       QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(1)
        sizePolicy.setHeightForWidth(
            self.splitter.sizePolicy().hasHeightForWidth())
        self.splitter.setSizePolicy(sizePolicy)
        self.splitter.setOrientation(QtCore.Qt.Horizontal)
        self.splitter.setObjectName(_fromUtf8("splitter"))
        self.lstStreet = QtGui.QListView(self.splitter)
        self.lstStreet.setObjectName(_fromUtf8("lstStreet"))
        self.lstHouse = QtGui.QListView(self.splitter)
        self.lstHouse.setObjectName(_fromUtf8("lstHouse"))
        self.gridLayout.addWidget(self.splitter, 5, 1, 1, 1)

        self.retranslateUi(PopulationStructureDetailedSetup)
        QtCore.QObject.connect(self.buttonBox,
                               QtCore.SIGNAL(_fromUtf8("accepted()")),
                               PopulationStructureDetailedSetup.accept)
        QtCore.QObject.connect(self.buttonBox,
                               QtCore.SIGNAL(_fromUtf8("rejected()")),
                               PopulationStructureDetailedSetup.reject)
        QtCore.QMetaObject.connectSlotsByName(PopulationStructureDetailedSetup)
예제 #33
0
    def setupUi(self, Editor):
        Editor.setObjectName(_fromUtf8("Editor"))
        Editor.setWindowModality(QtCore.Qt.NonModal)
        Editor.resize(600, 459)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,
                                       QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(Editor.sizePolicy().hasHeightForWidth())
        Editor.setSizePolicy(sizePolicy)
        self.gridLayout_6 = QtGui.QGridLayout(Editor)
        self.gridLayout_6.setObjectName(_fromUtf8("gridLayout_6"))
        self.gridLayout = QtGui.QGridLayout()
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        self.frame = QtGui.QFrame(Editor)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum,
                                       QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.frame.sizePolicy().hasHeightForWidth())
        self.frame.setSizePolicy(sizePolicy)
        self.frame.setMaximumSize(QtCore.QSize(16777215, 50))
        self.frame.setFrameShape(QtGui.QFrame.StyledPanel)
        self.frame.setFrameShadow(QtGui.QFrame.Raised)
        self.frame.setObjectName(_fromUtf8("frame"))
        self.gridLayout_5 = QtGui.QGridLayout(self.frame)
        self.gridLayout_5.setObjectName(_fromUtf8("gridLayout_5"))
        self.horizontalLayout = QtGui.QHBoxLayout()
        self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
        self.comboHotkeys = QtGui.QComboBox(self.frame)
        self.comboHotkeys.setObjectName(_fromUtf8("comboHotkeys"))
        self.horizontalLayout.addWidget(self.comboHotkeys)
        self.pushSave = QtGui.QPushButton(self.frame)
        self.pushSave.setObjectName(_fromUtf8("pushSave"))
        self.horizontalLayout.addWidget(self.pushSave)
        self.pushNew = QtGui.QPushButton(self.frame)
        self.pushNew.setObjectName(_fromUtf8("pushNew"))
        self.horizontalLayout.addWidget(self.pushNew)
        self.gridLayout_5.addLayout(self.horizontalLayout, 0, 0, 1, 1)
        self.gridLayout.addWidget(self.frame, 0, 0, 1, 1)
        self.buttonBox = QtGui.QDialogButtonBox(Editor)
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel
                                          | QtGui.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
        self.gridLayout.addWidget(self.buttonBox, 2, 0, 1, 1)
        self.frame_2 = QtGui.QFrame(Editor)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred,
                                       QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.frame_2.sizePolicy().hasHeightForWidth())
        self.frame_2.setSizePolicy(sizePolicy)
        self.frame_2.setFrameShape(QtGui.QFrame.StyledPanel)
        self.frame_2.setFrameShadow(QtGui.QFrame.Raised)
        self.frame_2.setObjectName(_fromUtf8("frame_2"))
        self.gridLayout_2 = QtGui.QGridLayout(self.frame_2)
        self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2"))
        self.verticalLayout = QtGui.QVBoxLayout()
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.horizontalLayout_3 = QtGui.QHBoxLayout()
        self.horizontalLayout_3.setObjectName(_fromUtf8("horizontalLayout_3"))
        self.label_4 = QtGui.QLabel(self.frame_2)
        self.label_4.setObjectName(_fromUtf8("label_4"))
        self.horizontalLayout_3.addWidget(self.label_4)
        self.description = QtGui.QLineEdit(self.frame_2)
        self.description.setObjectName(_fromUtf8("description"))
        self.horizontalLayout_3.addWidget(self.description)
        self.label_5 = QtGui.QLabel(self.frame_2)
        self.label_5.setObjectName(_fromUtf8("label_5"))
        self.horizontalLayout_3.addWidget(self.label_5)
        self.webSite = QtGui.QLineEdit(self.frame_2)
        self.webSite.setObjectName(_fromUtf8("webSite"))
        self.horizontalLayout_3.addWidget(self.webSite)
        self.verticalLayout.addLayout(self.horizontalLayout_3)
        self.horizontalLayout_2 = QtGui.QHBoxLayout()
        self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2"))
        self.label = QtGui.QLabel(self.frame_2)
        self.label.setMaximumSize(QtCore.QSize(16777215, 367))
        self.label.setObjectName(_fromUtf8("label"))
        self.horizontalLayout_2.addWidget(self.label)
        self.fileVersion = QtGui.QLineEdit(self.frame_2)
        self.fileVersion.setObjectName(_fromUtf8("fileVersion"))
        self.horizontalLayout_2.addWidget(self.fileVersion)
        self.label_3 = QtGui.QLabel(self.frame_2)
        self.label_3.setObjectName(_fromUtf8("label_3"))
        self.horizontalLayout_2.addWidget(self.label_3)
        self.softwareName = QtGui.QLineEdit(self.frame_2)
        self.softwareName.setObjectName(_fromUtf8("softwareName"))
        self.horizontalLayout_2.addWidget(self.softwareName)
        self.label_2 = QtGui.QLabel(self.frame_2)
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.horizontalLayout_2.addWidget(self.label_2)
        self.softwareVersion = QtGui.QLineEdit(self.frame_2)
        self.softwareVersion.setObjectName(_fromUtf8("softwareVersion"))
        self.horizontalLayout_2.addWidget(self.softwareVersion)
        self.verticalLayout.addLayout(self.horizontalLayout_2)
        self.horizontalLayout_4 = QtGui.QHBoxLayout()
        self.horizontalLayout_4.setObjectName(_fromUtf8("horizontalLayout_4"))
        self.totalQuestion = QtGui.QLabel(self.frame_2)
        self.totalQuestion.setObjectName(_fromUtf8("totalQuestion"))
        self.horizontalLayout_4.addWidget(self.totalQuestion)
        self.pushNewQuestion = QtGui.QPushButton(self.frame_2)
        self.pushNewQuestion.setObjectName(_fromUtf8("pushNewQuestion"))
        self.horizontalLayout_4.addWidget(self.pushNewQuestion)
        self.verticalLayout.addLayout(self.horizontalLayout_4)
        self.gridLayout_3 = QtGui.QGridLayout()
        self.gridLayout_3.setObjectName(_fromUtf8("gridLayout_3"))
        self.listQuestion = QtGui.QListWidget(self.frame_2)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed,
                                       QtGui.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.listQuestion.sizePolicy().hasHeightForWidth())
        self.listQuestion.setSizePolicy(sizePolicy)
        self.listQuestion.setMaximumSize(QtCore.QSize(250, 16777215))
        self.listQuestion.setObjectName(_fromUtf8("listQuestion"))
        self.gridLayout_3.addWidget(self.listQuestion, 0, 0, 1, 1)
        self.groupBox = QtGui.QGroupBox(self.frame_2)
        self.groupBox.setObjectName(_fromUtf8("groupBox"))
        self.gridLayout_7 = QtGui.QGridLayout(self.groupBox)
        self.gridLayout_7.setObjectName(_fromUtf8("gridLayout_7"))
        self.gridLayout_4 = QtGui.QGridLayout()
        self.gridLayout_4.setObjectName(_fromUtf8("gridLayout_4"))
        self.label_6 = QtGui.QLabel(self.groupBox)
        self.label_6.setObjectName(_fromUtf8("label_6"))
        self.gridLayout_4.addWidget(self.label_6, 0, 0, 1, 1)
        self.hotkey = QtGui.QLineEdit(self.groupBox)
        self.hotkey.setObjectName(_fromUtf8("hotkey"))
        self.gridLayout_4.addWidget(self.hotkey, 3, 0, 1, 1)
        self.label_7 = QtGui.QLabel(self.groupBox)
        self.label_7.setObjectName(_fromUtf8("label_7"))
        self.gridLayout_4.addWidget(self.label_7, 2, 0, 1, 1)
        self.question = QtGui.QTextEdit(self.groupBox)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,
                                       QtGui.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.question.sizePolicy().hasHeightForWidth())
        self.question.setSizePolicy(sizePolicy)
        self.question.setMaximumSize(QtCore.QSize(16777215, 90))
        self.question.setObjectName(_fromUtf8("question"))
        self.gridLayout_4.addWidget(self.question, 1, 0, 1, 1)
        self.gridLayout_7.addLayout(self.gridLayout_4, 0, 0, 1, 1)
        self.gridLayout_3.addWidget(self.groupBox, 0, 1, 1, 1)
        self.verticalLayout.addLayout(self.gridLayout_3)
        self.gridLayout_2.addLayout(self.verticalLayout, 0, 0, 1, 1)
        self.gridLayout.addWidget(self.frame_2, 1, 0, 1, 1)
        self.gridLayout_6.addLayout(self.gridLayout, 0, 0, 1, 1)

        self.retranslateUi(Editor)
        QtCore.QObject.connect(self.buttonBox,
                               QtCore.SIGNAL(_fromUtf8("accepted()")),
                               Editor.accept)
        QtCore.QObject.connect(self.buttonBox,
                               QtCore.SIGNAL(_fromUtf8("rejected()")),
                               Editor.reject)
        QtCore.QMetaObject.connectSlotsByName(Editor)
예제 #34
0
def main():
    app = QtGui.QApplication(sys.argv)
    window = MainWindow()
    window.show()
    window.set_bot()
    sys.exit(app.exec_())
예제 #35
0
 def center(self):
     # centers the application on the screen
     window = self.frameGeometry()
     screen_center = QtGui.QDesktopWidget().availableGeometry().center()
     window.moveCenter(screen_center)
     self.move(window.topLeft())
예제 #36
0
    def setupUi(self, MainWindow):
        MainWindow.setObjectName(_fromUtf8("MainWindow"))
        MainWindow.setEnabled(True)
        MainWindow.resize(886, 600)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum,
                                       QtGui.QSizePolicy.Minimum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(MainWindow.sizePolicy().hasHeightForWidth())
        MainWindow.setSizePolicy(sizePolicy)
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Dyuthi"))
        font.setItalic(False)
        MainWindow.setFont(font)
        MainWindow.setMouseTracking(True)
        MainWindow.setFocusPolicy(QtCore.Qt.NoFocus)

        # define layouts for the window
        self.centralwidget = QtGui.QWidget(MainWindow)
        self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
        self.gridLayout_2 = QtGui.QGridLayout(self.centralwidget)
        self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2"))
        self.verticalLayout = QtGui.QVBoxLayout()
        self.verticalLayout.setSpacing(6)
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))

        self.line_7 = QtGui.QFrame(self.centralwidget)
        self.line_7.setFrameShape(QtGui.QFrame.HLine)
        self.line_7.setFrameShadow(QtGui.QFrame.Sunken)
        self.line_7.setObjectName(_fromUtf8("line_7"))
        self.verticalLayout.addWidget(self.line_7)

        # define image display area
        self.imageDisplayLabel = QtGui.QLabel(self.centralwidget)
        self.imageDisplayLabel.setAlignment(QtCore.Qt.AlignHCenter
                                            |QtCore.Qt.AlignVCenter)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding,
                                       QtGui.QSizePolicy.MinimumExpanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.imageDisplayLabel.sizePolicy().
                                     hasHeightForWidth())
        self.imageDisplayLabel.setSizePolicy(sizePolicy)
        self.imageDisplayLabel.setAutoFillBackground(False)
        self.imageDisplayLabel.setStyleSheet(_fromUtf8("background-color: "
                                                       "rgb(255, 255, 255);"))
        self.imageDisplayLabel.setText(_fromUtf8(""))
        self.imageDisplayLabel.setObjectName(_fromUtf8("imageDisplayLabel"))
        self.verticalLayout.addWidget(self.imageDisplayLabel)

        self.gridLayout_2.addLayout(self.verticalLayout, 1, 3, 2, 1)
        self.verticalLayout_3 = QtGui.QVBoxLayout()
        self.verticalLayout_3.setSizeConstraint(QtGui.QLayout.SetFixedSize)
        self.verticalLayout_3.setObjectName(_fromUtf8("verticalLayout_3"))
        self.horizontalLayout = QtGui.QHBoxLayout()
        self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))

        # define Open button
        self.openImageButton = QtGui.QPushButton(self.centralwidget)
        self.openImageButton.setObjectName(_fromUtf8("openImageButton"))
        self.horizontalLayout.addWidget(self.openImageButton)

        # define Save button
        self.saveImageButton = QtGui.QPushButton(self.centralwidget)
        self.saveImageButton.setObjectName(_fromUtf8("saveImageButton"))
        self.saveImageButton.setEnabled(False)
        self.horizontalLayout.addWidget(self.saveImageButton)
        self.verticalLayout_3.addLayout(self.horizontalLayout)

        self.line_6 = QtGui.QFrame(self.centralwidget)
        self.line_6.setFrameShape(QtGui.QFrame.HLine)
        self.line_6.setFrameShadow(QtGui.QFrame.Sunken)
        self.line_6.setObjectName(_fromUtf8("line_6"))
        self.verticalLayout_3.addWidget(self.line_6)

        # define Histogram Equalization button
        self.histogramEqualizationButton = QtGui.QPushButton(self.centralwidget)
        self.histogramEqualizationButton.setEnabled(False)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.
                                       QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.histogramEqualizationButton.
                                     sizePolicy().hasHeightForWidth())
        self.histogramEqualizationButton.setSizePolicy(sizePolicy)
        self.histogramEqualizationButton.setObjectName(
            _fromUtf8("histogramEqualizationButton"))
        self.verticalLayout_3.addWidget(self.histogramEqualizationButton)

        # define View Histogram button
        self.viewHistogramButton = QtGui.QPushButton(self.centralwidget)
        self.viewHistogramButton.setObjectName(_fromUtf8("viewHistogramButton"))
        self.verticalLayout_3.addWidget(self.viewHistogramButton)

        self.line_10 = QtGui.QFrame(self.centralwidget)
        self.line_10.setFrameShape(QtGui.QFrame.HLine)
        self.line_10.setFrameShadow(QtGui.QFrame.Sunken)
        self.line_10.setObjectName(_fromUtf8("line_10"))
        self.verticalLayout_3.addWidget(self.line_10)

        # define Gamma Correction button
        self.gammaCorrectionButton = QtGui.QPushButton(self.centralwidget)
        self.gammaCorrectionButton.setObjectName(_fromUtf8("gammaCorrectionButton"))
        self.gammaCorrectionButton.setEnabled(False)
        self.verticalLayout_3.addWidget(self.gammaCorrectionButton)

        # define Log Transform button
        self.logTransformButton = QtGui.QPushButton(self.centralwidget)
        self.logTransformButton.setObjectName(_fromUtf8("logTransformButton"))
        self.logTransformButton.setEnabled(False)
        self.verticalLayout_3.addWidget(self.logTransformButton)

        # define Image Negative button
        self.negativeButton = QtGui.QPushButton(self.centralwidget)
        self.negativeButton.setObjectName(_fromUtf8("negativeButton"))
        self.negativeButton.setEnabled(False)
        self.verticalLayout_3.addWidget(self.negativeButton)

        self.line_2 = QtGui.QFrame(self.centralwidget)
        self.line_2.setFrameShape(QtGui.QFrame.HLine)
        self.line_2.setFrameShadow(QtGui.QFrame.Sunken)
        self.line_2.setObjectName(_fromUtf8("line_2"))
        self.verticalLayout_3.addWidget(self.line_2)

        self.horizontalLayout_9 = QtGui.QHBoxLayout()
        self.horizontalLayout_9.setObjectName(_fromUtf8("horizontalLayout_9"))

        # define Blur Slider Name label
        self.blurLabel = QtGui.QLabel(self.centralwidget)
        self.blurLabel.setObjectName(_fromUtf8("blurLabel"))
        self.horizontalLayout_9.addWidget(self.blurLabel)

        self.blurValueLabel = QtGui.QLabel(self.centralwidget)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed,
                                       QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.blurValueLabel.sizePolicy()
                                     .hasHeightForWidth())

        # define Blur Slider Value label
        self.blurValueLabel.setSizePolicy(sizePolicy)
        self.blurValueLabel.setAlignment(QtCore.Qt.AlignRight|QtCore
                                         .Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
        self.blurValueLabel.setObjectName(_fromUtf8("blurValueLabel"))
        self.horizontalLayout_9.addWidget(self.blurValueLabel)

        self.verticalLayout_3.addLayout(self.horizontalLayout_9)

        # define blur slider
        self.blurExtendInputSlider = QtGui.QSlider(self.centralwidget)
        self.blurExtendInputSlider.setOrientation(QtCore.Qt.Horizontal)
        self.blurExtendInputSlider.setObjectName(_fromUtf8("blurExtendInputSlider"))
        self.blurExtendInputSlider.setRange(0,10)
        self.blurExtendInputSlider.setEnabled(False)
        self.verticalLayout_3.addWidget(self.blurExtendInputSlider)

        self.line_3 = QtGui.QFrame(self.centralwidget)
        self.line_3.setFrameShape(QtGui.QFrame.HLine)
        self.line_3.setFrameShadow(QtGui.QFrame.Sunken)
        self.line_3.setObjectName(_fromUtf8("line_3"))
        self.verticalLayout_3.addWidget(self.line_3)

        self.horizontalLayout_10 = QtGui.QHBoxLayout()
        self.horizontalLayout_10.setObjectName(_fromUtf8("horizontalLayout_10"))

        # define Sharpen Slider Name label
        self.sharpenLabel = QtGui.QLabel(self.centralwidget)
        self.sharpenLabel.setObjectName(_fromUtf8("sharpenLabel"))
        self.horizontalLayout_10.addWidget(self.sharpenLabel)

        self.sharpenValueLabel = QtGui.QLabel(self.centralwidget)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed,
                                       QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.sharpenValueLabel.sizePolicy()
                                     .hasHeightForWidth())

        # define Sharpen Slider Value label
        self.sharpenValueLabel.setSizePolicy(sizePolicy)
        self.sharpenValueLabel.setAlignment(QtCore.Qt.AlignRight|QtCore
                                            .Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
        self.sharpenValueLabel.setObjectName(_fromUtf8("sharpenValueLabel"))
        self.horizontalLayout_10.addWidget(self.sharpenValueLabel)

        self.verticalLayout_3.addLayout(self.horizontalLayout_10)

        # define Sharpen Slider
        self.sharpenExtendInputSlider = QtGui.QSlider(self.centralwidget)
        self.sharpenExtendInputSlider.setOrientation(QtCore.Qt.Horizontal)
        self.sharpenExtendInputSlider.setObjectName(
            _fromUtf8("sharpenExtendInputSlider"))
        self.sharpenExtendInputSlider.setRange(0, 10)
        self.sharpenExtendInputSlider.setEnabled(False)
        self.verticalLayout_3.addWidget(self.sharpenExtendInputSlider)

        self.line_4 = QtGui.QFrame(self.centralwidget)
        self.line_4.setFrameShape(QtGui.QFrame.HLine)
        self.line_4.setFrameShadow(QtGui.QFrame.Sunken)
        self.line_4.setObjectName(_fromUtf8("line_4"))
        self.verticalLayout_3.addWidget(self.line_4)

        self.horizontalLayout_4 = QtGui.QHBoxLayout()
        self.horizontalLayout_4.setObjectName(_fromUtf8("horizontalLayout_4"))

        # define Undo button
        self.undoButton = QtGui.QPushButton(self.centralwidget)
        self.undoButton.setObjectName(_fromUtf8("undoButton"))
        self.undoButton.setEnabled(False)
        self.horizontalLayout_4.addWidget(self.undoButton)

        # define Undo All button
        self.undoAllButton = QtGui.QPushButton(self.centralwidget)
        self.undoAllButton.setObjectName(_fromUtf8("undoAllButton"))
        self.undoAllButton.setEnabled(False)
        self.horizontalLayout_4.addWidget(self.undoAllButton)

        self.verticalLayout_3.addLayout(self.horizontalLayout_4)

        self.line = QtGui.QFrame(self.centralwidget)
        self.line.setFrameShape(QtGui.QFrame.HLine)
        self.line.setFrameShadow(QtGui.QFrame.Sunken)
        self.line.setObjectName(_fromUtf8("line"))
        self.verticalLayout_3.addWidget(self.line)

        # define Edge Detection button
        self.detectEdgeButton = QtGui.QPushButton(self.centralwidget)
        self.detectEdgeButton.setObjectName(_fromUtf8("detectEdgeButton"))
        self.verticalLayout_3.addWidget(self.detectEdgeButton)

        self.line_9 = QtGui.QFrame(self.centralwidget)
        self.line_9.setFrameShape(QtGui.QFrame.HLine)
        self.line_9.setFrameShadow(QtGui.QFrame.Sunken)
        self.line_9.setObjectName(_fromUtf8("line_9"))
        self.verticalLayout_3.addWidget(self.line_9)

        self.detectEdgeButton.setEnabled(False)
        self.viewHistogramButton.setEnabled(False)

        # progress label is not used
        self.progressLabel = QtGui.QLabel(self.centralwidget)
        self.progressLabel.setText(_fromUtf8(""))
        self.progressLabel.setObjectName(_fromUtf8("progressLabel"))
        self.verticalLayout_3.addWidget(self.progressLabel)

        spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum,
                                       QtGui.QSizePolicy.Expanding)
        self.verticalLayout_3.addItem(spacerItem)
        self.gridLayout_2.addLayout(self.verticalLayout_3, 2, 0, 1, 2)
        self.line_5 = QtGui.QFrame(self.centralwidget)
        self.line_5.setFrameShape(QtGui.QFrame.VLine)
        self.line_5.setFrameShadow(QtGui.QFrame.Sunken)
        self.line_5.setObjectName(_fromUtf8("line_5"))

        self.gridLayout_2.addWidget(self.line_5, 2, 2, 1, 1)
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtGui.QMenuBar(MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 886, 25))
        self.menubar.setObjectName(_fromUtf8("menubar"))
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QtGui.QStatusBar(MainWindow)
        self.statusbar.setObjectName(_fromUtf8("statusbar"))
        MainWindow.setStatusBar(self.statusbar)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)
예제 #37
0
    def __init__(self):
        super(Window,self).__init__()
        self.command= ''
        self.dirs = []
        self.dir_files =[]
        file_browse = QtGui.QPushButton( 'Browse' ,self)
        file_browse.clicked.connect(self.getfiles)
        self.filename = ''
        file_browse.move(10,40)
        file_browse.resize(640,40)
        #comboBox1 = QtGui.QComboBox(self)
        self.l1 = QLabel(self)
        self.l2 = QLabel(self)
        self.l1.setText('Choose the folder containing the Multi-channel audios')
        
        self.l1.move(10,10)
        self.l1.setStyleSheet('color: brown ')
        self.l1.setFont(QtGui.QFont("Times", 14, QtGui.QFont.Bold))
        self.l1.resize(self.l1.sizeHint())
        self.noc = QLabel(self)
        self.noc.move(10,80)
        
        #comboBox1.addItem('GCC-PHAT')
        #comboBox1.addItem('GCC-SCOT')
        #comboBox1.activated[str].connect(self.style_choice)
        self.l7 = QLabel(self)
        self.l7.setText('Select the enhancement to be performed')
        self.l7.move(10,290)
        self.l7.setStyleSheet('color: brown ')
        self.l7.setFont(QtGui.QFont("Times", 14, QtGui.QFont.Bold))
        self.l7.resize(self.l7.sizeHint())
        self.comboBox1 = QtGui.QComboBox(self)
        self.comboBox1.move(10,110)
        self.comboBox1.resize(400,40)
        self.comboBox1.hide()
        #self.comboBox1.activated[str].connect(self.style_choice)
        self.puss = QtGui.QPushButton( 'Play' ,self)
        self.puss.clicked.connect(self.play)
        self.puss.move(420,110)
        self.puss.resize(80,40)
        self.puss.hide()
        self.dec = QtGui.QPushButton( 'Decode' ,self)
        self.dec.move(520,110)
        self.dec.resize(80,40)
        self.dec.hide()
        self.wer1 = QLabel(self)
        self.wer1.move(620,105)
        self.wer1.hide()
        self.dec.clicked.connect(self.decode)
        self.comboBox2 = QtGui.QComboBox(self)
        self.comboBox2.addItem('Beamformit')
        self.comboBox2.addItem('Max Array')
        self.comboBox2.addItem('MVDR')
        self.comboBox2.addItem('GDSB')
        self.comboBox2.setEnabled(False)
        #self.comboBox2.activated[str].connect(self.style_choice)
        self.text1 = ''
        self.text2= ''
        self.comboBox2.move(10,320)
        self.comboBox2.resize(640,40)
        self.run_enh = QtGui.QPushButton( 'Run' ,self)
        self.run_enh.clicked.connect(self.enhan)
        self.run_enh.move(670,320)
        self.run_enh.resize(80,40)
        self.run_enh.setEnabled(False)
        self.textbox = QTextEdit(self)
        self.textbox.hide() 
        self.l8 = QLabel(self)
        self.process = QtCore.QProcess(self)
        self.process.readyReadStandardOutput.connect(self.handleStdOut)
        self.process.readyReadStandardError.connect(self.handleStdErr)
        self.process.finished.connect(self.emit)
        self.process1 = QtCore.QProcess(self)
        self.process1.readyReadStandardOutput.connect(self.handleStdOut)
        self.process1.readyReadStandardError.connect(self.handleStdErr)
        self.process1.finished.connect(self.emit1) 
        self.process2 = QtCore.QProcess(self)
        self.process2.readyReadStandardOutput.connect(self.handleStdOut)
        self.process2.readyReadStandardError.connect(self.handleStdErr)
        self.process2.finished.connect(self.emit2) 
        self.l9 = QLabel(self)
        self.l9.hide()
        self.puss_enh = QtGui.QPushButton( 'Play' ,self)
        self.puss_enh.clicked.connect(self.play1)
        self.puss_enh.move(420,530)
        self.puss_enh.resize(80,40)
        self.puss_enh.hide()
        self.dec_enh = QtGui.QPushButton( 'Decode' ,self)
        self.dec_enh.move(520,530)
        self.dec_enh.resize(80,40)
        self.dec_enh.hide()
        self.dec_enh.clicked.connect(self.decode1)
        self.quit = QtGui.QPushButton( 'Quit' ,self)
        self.quit.move(360,700)
        self.quit.resize(self.quit.sizeHint())
        self.quit.clicked.connect(self.close_application)
        self.wer2 = QLabel(self)
        self.wer2.move(620,525)
        self.wer2.hide()
        self.log1 = QLabel(self)
        self.log1.move(520,160)
        self.log1.hide()
        self.log2 = QLabel(self)
        self.log2.move(510,575)
        self.log2.hide()    

        #self.dialog = Second(self)
        #horizontalLayout = QtGui.QHBoxLayout(self)
        #horizontalLayout.addWidget( comboBox1 )
        #horizontalLayout.addWidget( comboBox2 )
        #run_asr = QtGui.QPushButton( 'ASR' ,self)
        #run_asr.clicked.connect(self.getasr)
        #run_asr.move(10,390)
        #run_asr.resize(300,30)
        #run_asr.resize(run_asr.sizeHint())
        #self.asr_out = QLineEdit("Hello Python")
        #self.asr_out.resize(self.asr_out.sizeHint())
        #self.asr_out.setFixedWidth(100)
        #verticalLayout = QtGui.QVBoxLayout( self )
        #verticalLayout.addWidget( file_browse )
        #verticalLayout.addStretch(0.5)
        #verticalLayout.addLayout( horizontalLayout )
        
        #verticalLayout.addWidget( run_asr )
        #verticalLayout.addStretch(1)
        #verticalLayout.addWidget( self.asr_out )
        #self.setLayout( verticalLayout )
        
        #self.setLayout(vbox)
        #mainMenu = self.menuBar()
        #fileMenu = mainMenu.addMenu('&File')
        #fileMenu.addAction(extractAction)
        #self.editor()
        #self.home()
        
        self.setGeometry(500,200,800,800)
        self.setWindowTitle('IITB-TCS--GUI')
        self.setWindowIcon(QtGui.QIcon('tcs.png'))
        #extractAction = QtGui.QAction('Get to the chopper',self)
        #extractAction.setShortcut('Ctrl+Q')
        #extractAction.setStatusTip('Leave the app')
        #extractAction.triggered.connect(self.close_application)

        #self.statusBar()
        self.show()
예제 #38
0
 def ocultar_puntero_del_mouse(self):
     self.widget.setCursor(QtGui.QCursor(QtCore.Qt.BlankCursor))
예제 #39
0
파일: Detector.py 프로젝트: yue123161/botd
 def center(self):
     qr = self.frameGeometry()
     cp = QtGui.QDesktopWidget().availableGeometry().center()
     qr.moveCenter(cp)
     self.move(qr.topLeft())
    def set_from(self, project):
        # section = core.swmm.project.CrossSection()
        self.listWidget.addItems(('Rectangular', 'Trapezoidal', 'Triangular', 'Parabolic', 'Power',
                                  'Irregular', 'Circular', 'Force Main', 'Filled Circular',
                                  'Closed Rectangular', 'Horizontal Elliptical', 'Vertical Elliptical',
                                  'Arch', 'Rectangular Triangular', 'Rectangular Round', 'Modified Baskethandle',
                                  'Egg', 'Horseshoe', 'Gothic', 'Catenary', 'Semi-Elliptical', 'Baskethandle',
                                  'Semi-Circular', 'Custom', 'Dummy'))
        self.listWidget.item(0).setIcon(QtGui.QIcon("./swmmimages/1rect.png"))
        self.listWidget.item(1).setIcon(QtGui.QIcon("./swmmimages/2trap.png"))
        self.listWidget.item(2).setIcon(QtGui.QIcon("./swmmimages/3tri.png"))
        self.listWidget.item(3).setIcon(QtGui.QIcon("./swmmimages/4para.png"))
        self.listWidget.item(4).setIcon(QtGui.QIcon("./swmmimages/5power.png"))
        self.listWidget.item(5).setIcon(QtGui.QIcon("./swmmimages/6irreg.png"))
        self.listWidget.item(6).setIcon(QtGui.QIcon("./swmmimages/7circ.png"))
        self.listWidget.item(7).setIcon(QtGui.QIcon("./swmmimages/8force.png"))
        self.listWidget.item(8).setIcon(QtGui.QIcon("./swmmimages/9filled.png"))
        self.listWidget.item(9).setIcon(QtGui.QIcon("./swmmimages/10closed.png"))
        self.listWidget.item(10).setIcon(QtGui.QIcon("./swmmimages/11horiz.png"))
        self.listWidget.item(11).setIcon(QtGui.QIcon("./swmmimages/12vert.png"))
        self.listWidget.item(12).setIcon(QtGui.QIcon("./swmmimages/13arch.png"))
        self.listWidget.item(13).setIcon(QtGui.QIcon("./swmmimages/14recttri.png"))
        self.listWidget.item(14).setIcon(QtGui.QIcon("./swmmimages/15rectround.png"))
        self.listWidget.item(15).setIcon(QtGui.QIcon("./swmmimages/16basket.png"))
        self.listWidget.item(16).setIcon(QtGui.QIcon("./swmmimages/17egg.png"))
        self.listWidget.item(17).setIcon(QtGui.QIcon("./swmmimages/18horse.png"))
        self.listWidget.item(18).setIcon(QtGui.QIcon("./swmmimages/19goth.png"))
        self.listWidget.item(19).setIcon(QtGui.QIcon("./swmmimages/20cat.png"))
        self.listWidget.item(20).setIcon(QtGui.QIcon("./swmmimages/21semi.png"))
        self.listWidget.item(21).setIcon(QtGui.QIcon("./swmmimages/22bask.png"))
        self.listWidget.item(22).setIcon(QtGui.QIcon("./swmmimages/23semi.png"))
        self.listWidget.item(23).setIcon(QtGui.QIcon("./swmmimages/24custom.png"))
        self.listWidget.item(24).setIcon(QtGui.QIcon("./swmmimages/25na.png"))

        self.listWidget_currentItemChanged()
예제 #41
0
    def __init__(self, parent=None):
        QtGui.QWidget.__init__(self, parent)
        self.setWindowTitle('Send to Amazon Settings')
        gridLayout = QtGui.QGridLayout()
        self.setLayout(gridLayout)

        self.emailLabel = QtGui.QLabel('Notification Email')
        gridLayout.addWidget(self.emailLabel, 0, 0)
        self.emailEdit = QtGui.QLineEdit()
        gridLayout.addWidget(self.emailEdit, 0, 1)
        """
        self.ncpusLabel = QtGui.QLabel('Number of CPUs')
        gridLayout.addWidget(self.ncpusLabel, 1, 0)
        self.ncpusEdit = QtGui.QLineEdit()
        self.ncpusEdit.setText("32")
        gridLayout.addWidget(self.ncpusEdit, 1, 1)
        """

        self.prefLabel = QtGui.QLabel('Preference')
        gridLayout.addWidget(self.prefLabel, 2, 0)
        self.prefCombo = QtGui.QComboBox()
        self.prefCombo.addItem("Performance", "performance")
        self.prefCombo.addItem("Cost", "cost")
        self.prefCombo.addItem("Manual", "manual")
        gridLayout.addWidget(self.prefCombo, 2, 1)
        self.connect(self.prefCombo,
                     QtCore.SIGNAL('currentIndexChanged(QString)'),
                     self.changeNodeInputs)
        """
        self.nodeLabel = QtGui.QLabel('Node Type')
        gridLayout.addWidget(self.nodeLabel, 3, 0)
        self.nodeCombo = QtGui.QComboBox()
        self.nodeCombo.addItem("Sandy Bridge", "san")
        self.nodeCombo.addItem("Westmere", "wes")
        self.nodeCombo.addItem("Nehalem", "neh")
        self.nodeCombo.addItem("Harpertown", "har")
        gridLayout.addWidget(self.nodeCombo, 3, 1)

        self.selectLabel = QtGui.QLabel('Number of Nodes')
        gridLayout.addWidget(self.selectLabel, 4, 0)
        self.selectEdit = QtGui.QLineEdit()
        self.selectEdit.setText("2")
        gridLayout.addWidget(self.selectEdit, 4, 1)
        """

        # Sandy bridge input
        self.sanLabel = QtGui.QLabel('Sandy Bridge')
        gridLayout.addWidget(self.sanLabel, 3, 0)
        self.sanEdit = QtGui.QLineEdit()
        self.sanEdit.setText("4")
        gridLayout.addWidget(self.sanEdit, 3, 1)

        # Sandy bridge input
        self.wesLabel = QtGui.QLabel('Westmere')
        gridLayout.addWidget(self.wesLabel, 4, 0)
        self.wesEdit = QtGui.QLineEdit()
        self.wesEdit.setText("2")
        gridLayout.addWidget(self.wesEdit, 4, 1)

        # Sandy bridge input
        self.nehLabel = QtGui.QLabel('Nehalem')
        gridLayout.addWidget(self.nehLabel, 5, 0)
        self.nehEdit = QtGui.QLineEdit()
        self.nehEdit.setText("1")
        gridLayout.addWidget(self.nehEdit, 5, 1)

        # Sandy bridge input
        self.harLabel = QtGui.QLabel('Harpertown')
        gridLayout.addWidget(self.harLabel, 6, 0)
        self.harEdit = QtGui.QLineEdit()
        self.harEdit.setText("1")
        gridLayout.addWidget(self.harEdit, 6, 1)

        self.sendButton = QtGui.QPushButton('Send to Amazon')
        gridLayout.addWidget(self.sendButton, 8, 1)
        self.connect(self.sendButton, QtCore.SIGNAL('clicked()'), self.send)
예제 #42
0
    def setupUi(self, InputDialogGuiClass):
        InputDialogGuiClass.setObjectName(_fromUtf8("InputDialogGuiClass"))
        InputDialogGuiClass.setWindowModality(QtCore.Qt.WindowModal)
        InputDialogGuiClass.setFixedWidth(360)
        InputDialogGuiClass.setFixedHeight(140)
        self.verticalLayout = QtGui.QVBoxLayout(InputDialogGuiClass)
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.horizontalLayout_2 = QtGui.QHBoxLayout()
        self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2"))
        self.label = QtGui.QLabel(InputDialogGuiClass)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.label.sizePolicy().hasHeightForWidth())
        self.label.setSizePolicy(sizePolicy)
        self.label.setObjectName(_fromUtf8("label"))
        self.horizontalLayout_2.addWidget(self.label)
        self.gammaInput = QtGui.QLineEdit(InputDialogGuiClass)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.gammaInput.sizePolicy().hasHeightForWidth())
        self.gammaInput.setSizePolicy(sizePolicy)
        self.gammaInput.setObjectName(_fromUtf8("lineEdit"))
        self.gammaInput.setText('1.00')
        self.gammaInput.setValidator(QtGui.QDoubleValidator(0, 10.0, 2, self.gammaInput))
        self.horizontalLayout_2.addWidget(self.gammaInput)
        self.verticalLayout.addLayout(self.horizontalLayout_2)
        self.label_2 = QtGui.QLabel(InputDialogGuiClass)
        self.label_2.setAlignment(QtCore.Qt.AlignCenter)
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.verticalLayout.addWidget(self.label_2)
        self.horizontalLayout_3 = QtGui.QHBoxLayout()
        self.horizontalLayout_3.setObjectName(_fromUtf8("horizontalLayout_3"))
        spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding,
                                       QtGui.QSizePolicy.Minimum)
        self.horizontalLayout_3.addItem(spacerItem)
        self.cancelButton = QtGui.QPushButton(InputDialogGuiClass)
        self.cancelButton.setObjectName(_fromUtf8("cancelButton"))
        self.horizontalLayout_3.addWidget(self.cancelButton)
        self.okButton = QtGui.QPushButton(InputDialogGuiClass)
        self.okButton.setObjectName(_fromUtf8("okButton"))
        self.horizontalLayout_3.addWidget(self.okButton)
        self.verticalLayout.addLayout(self.horizontalLayout_3)

        self.retranslateUi(InputDialogGuiClass)
        QtCore.QMetaObject.connectSlotsByName(InputDialogGuiClass)
예제 #43
0
    def setupUi(self, Dialog):
        Dialog.setObjectName(_fromUtf8("Dialog"))
        Dialog.resize(1028, 698)
        Dialog.setStyleSheet(_fromUtf8("background-color: rgb(91, 91, 91);"))
        self.groupBox = QtGui.QGroupBox(Dialog)
        self.groupBox.setGeometry(QtCore.QRect(0, -1, 1021, 91))
        self.groupBox.setStyleSheet(
            _fromUtf8("background-color: rgb(153, 204, 204);"))
        self.groupBox.setObjectName(_fromUtf8("groupBox"))
        self.textEdit = QtGui.QTextEdit(self.groupBox)
        self.textEdit.setGeometry(QtCore.QRect(140, 24, 541, 21))
        self.textEdit.setStyleSheet(
            _fromUtf8("background-color: rgb(255, 255, 255);"))
        self.textEdit.setObjectName(_fromUtf8("textEdit"))
        self.pushButton = QtGui.QPushButton(self.groupBox)
        self.pushButton.setGeometry(QtCore.QRect(140, 60, 83, 20))
        self.pushButton.setStyleSheet(
            _fromUtf8("color: rgb(255, 255, 255);\n"
                      "background-color: rgb(0, 192, 0);"))
        self.pushButton.setObjectName(_fromUtf8("pushButton"))
        self.pushButton_4 = QtGui.QPushButton(self.groupBox)
        self.pushButton_4.setGeometry(QtCore.QRect(230, 60, 83, 20))
        self.pushButton_4.setStyleSheet(
            _fromUtf8("background-color: rgb(255, 220, 168);"))
        self.pushButton_4.setObjectName(_fromUtf8("pushButton_4"))
        self.groupBox_3 = QtGui.QGroupBox(self.groupBox)
        self.groupBox_3.setGeometry(QtCore.QRect(4, 20, 131, 61))
        self.groupBox_3.setStyleSheet(
            _fromUtf8("background-color: rgb(51, 153, 204);"))
        self.groupBox_3.setObjectName(_fromUtf8("groupBox_3"))
        self.comboBox = QtGui.QComboBox(self.groupBox_3)
        self.comboBox.setGeometry(QtCore.QRect(10, 21, 111, 24))
        self.comboBox.setStyleSheet(
            _fromUtf8("background-color: rgb(220, 220, 220);"))
        self.comboBox.setObjectName(_fromUtf8("comboBox"))
        self.label_2 = QtGui.QLabel(self.groupBox)
        self.label_2.setGeometry(QtCore.QRect(419, 49, 141, 12))
        font = QtGui.QFont()
        font.setPointSize(7)
        self.label_2.setFont(font)
        self.label_2.setWordWrap(True)
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.pushButton_6 = QtGui.QPushButton(self.groupBox)
        self.pushButton_6.setGeometry(QtCore.QRect(952, 20, 51, 25))
        self.pushButton_6.setStyleSheet(
            _fromUtf8("background-color: rgb(192, 192, 0);"))
        self.pushButton_6.setObjectName(_fromUtf8("pushButton_6"))
        self.comboBox_2 = QtGui.QComboBox(self.groupBox)
        self.comboBox_2.setGeometry(QtCore.QRect(420, 60, 121, 20))
        self.comboBox_2.setStyleSheet(
            _fromUtf8("background-color: rgb(192, 192, 255);"))
        self.comboBox_2.setEditable(True)
        self.comboBox_2.setObjectName(_fromUtf8("comboBox_2"))
        self.comboBox_2.addItem(_fromUtf8(""))
        self.comboBox_2.addItem(_fromUtf8(""))
        self.comboBox_2.addItem(_fromUtf8(""))
        self.comboBox_2.addItem(_fromUtf8(""))
        self.comboBox_2.addItem(_fromUtf8(""))
        self.comboBox_2.addItem(_fromUtf8(""))
        self.comboBox_2.addItem(_fromUtf8(""))
        self.comboBox_2.addItem(_fromUtf8(""))
        self.comboBox_2.addItem(_fromUtf8(""))
        self.comboBox_2.addItem(_fromUtf8(""))
        self.comboBox_2.addItem(_fromUtf8(""))
        self.comboBox_2.addItem(_fromUtf8(""))
        self.comboBox_2.addItem(_fromUtf8(""))
        self.comboBox_2.addItem(_fromUtf8(""))
        self.comboBox_2.addItem(_fromUtf8(""))
        self.comboBox_2.addItem(_fromUtf8(""))
        self.comboBox_2.addItem(_fromUtf8(""))
        self.pushButton_2 = QtGui.QPushButton(self.groupBox)
        self.pushButton_2.setGeometry(QtCore.QRect(320, 60, 91, 20))
        self.pushButton_2.setStyleSheet(
            _fromUtf8("background-color: rgb(255, 220, 168);"))
        self.pushButton_2.setObjectName(_fromUtf8("pushButton_2"))
        self.groupBox_2 = QtGui.QGroupBox(Dialog)
        self.groupBox_2.setGeometry(QtCore.QRect(0, 100, 1021, 561))
        self.groupBox_2.setStyleSheet(_fromUtf8("color: rgb(204, 255, 102);"))
        self.groupBox_2.setObjectName(_fromUtf8("groupBox_2"))
        self.textEdit_2 = QtGui.QTextEdit(self.groupBox_2)
        self.textEdit_2.setGeometry(QtCore.QRect(6, 20, 1009, 523))
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Courier"))
        font.setPointSize(10)
        self.textEdit_2.setFont(font)
        self.textEdit_2.setStyleSheet(
            _fromUtf8("background-color: rgb(248, 255, 238);\n"
                      "color: rgb(7, 7, 7);"))
        self.textEdit_2.setObjectName(_fromUtf8("textEdit_2"))
        self.label_4 = QtGui.QLabel(self.groupBox_2)
        self.label_4.setGeometry(QtCore.QRect(10, 546, 231, 12))
        font = QtGui.QFont()
        font.setPointSize(10)
        self.label_4.setFont(font)
        self.label_4.setObjectName(_fromUtf8("label_4"))
        self.label = QtGui.QLabel(Dialog)
        self.label.setGeometry(QtCore.QRect(7, 675, 641, 16))
        self.label.setStyleSheet(_fromUtf8("color: rgb(102, 204, 51);"))
        self.label.setObjectName(_fromUtf8("label"))
        self.label_3 = QtGui.QLabel(Dialog)
        self.label_3.setGeometry(QtCore.QRect(140, 90, 431, 16))
        self.label_3.setStyleSheet(_fromUtf8("color: rgb(255, 255, 204);"))
        self.label_3.setObjectName(_fromUtf8("label_3"))
        self.pushButton_5 = QtGui.QPushButton(Dialog)
        self.pushButton_5.setGeometry(QtCore.QRect(830, 670, 83, 20))
        self.pushButton_5.setStyleSheet(
            _fromUtf8("background-color: rgb(0, 128, 128);\n"
                      "color: rgb(255, 255, 255);"))
        self.pushButton_5.setObjectName(_fromUtf8("pushButton_5"))
        self.pushButton_3 = QtGui.QPushButton(Dialog)
        self.pushButton_3.setGeometry(QtCore.QRect(930, 670, 83, 20))
        self.pushButton_3.setStyleSheet(
            _fromUtf8("background-color: rgb(255, 46, 10);\n"
                      "color: rgb(255, 255, 255);"))
        self.pushButton_3.setObjectName(_fromUtf8("pushButton_3"))

        self.retranslateUi(Dialog)
        QtCore.QObject.connect(self.pushButton_3,
                               QtCore.SIGNAL(_fromUtf8("clicked()")),
                               Dialog.close)
        QtCore.QMetaObject.connectSlotsByName(Dialog)
예제 #44
0
    def __init__(self, parent, logger):
        QtGui.QDialog.__init__(self, parent)

        self.logger = logger

        self.setWindowTitle("Spectrum settings")

        self.formLayout = QtGui.QFormLayout(self)

        self.comboBox_dual_channel = QtGui.QComboBox(self)
        self.comboBox_dual_channel.setObjectName("dual")
        self.comboBox_dual_channel.addItem("Single-channel")
        self.comboBox_dual_channel.addItem("Dual-channel")
        self.comboBox_dual_channel.setCurrentIndex(0)

        self.comboBox_fftsize = QtGui.QComboBox(self)
        self.comboBox_fftsize.setObjectName("comboBox_fftsize")
        self.comboBox_fftsize.addItem("32 points")
        self.comboBox_fftsize.addItem("64 points")
        self.comboBox_fftsize.addItem("128 points")
        self.comboBox_fftsize.addItem("256 points")
        self.comboBox_fftsize.addItem("512 points")
        self.comboBox_fftsize.addItem("1024 points")
        self.comboBox_fftsize.addItem("2048 points")
        self.comboBox_fftsize.addItem("4096 points")
        self.comboBox_fftsize.addItem("8192 points")
        self.comboBox_fftsize.addItem("16384 points")
        self.comboBox_fftsize.setCurrentIndex(DEFAULT_FFT_SIZE)

        self.comboBox_freqscale = QtGui.QComboBox(self)
        self.comboBox_freqscale.setObjectName("comboBox_freqscale")
        self.comboBox_freqscale.addItem("Linear")
        self.comboBox_freqscale.addItem("Logarithmic")
        self.comboBox_freqscale.setCurrentIndex(DEFAULT_FREQ_SCALE)

        self.spinBox_minfreq = QtGui.QSpinBox(self)
        self.spinBox_minfreq.setMinimum(20)
        self.spinBox_minfreq.setMaximum(SAMPLING_RATE / 2)
        self.spinBox_minfreq.setSingleStep(10)
        self.spinBox_minfreq.setValue(DEFAULT_MINFREQ)
        self.spinBox_minfreq.setObjectName("spinBox_minfreq")
        self.spinBox_minfreq.setSuffix(" Hz")

        self.spinBox_maxfreq = QtGui.QSpinBox(self)
        self.spinBox_maxfreq.setMinimum(20)
        self.spinBox_maxfreq.setMaximum(SAMPLING_RATE / 2)
        self.spinBox_maxfreq.setSingleStep(1000)
        self.spinBox_maxfreq.setProperty("value", DEFAULT_MAXFREQ)
        self.spinBox_maxfreq.setObjectName("spinBox_maxfreq")
        self.spinBox_maxfreq.setSuffix(" Hz")

        self.spinBox_specmin = QtGui.QSpinBox(self)
        self.spinBox_specmin.setKeyboardTracking(False)
        self.spinBox_specmin.setMinimum(-200)
        self.spinBox_specmin.setMaximum(200)
        self.spinBox_specmin.setProperty("value", DEFAULT_SPEC_MIN)
        self.spinBox_specmin.setObjectName("spinBox_specmin")
        self.spinBox_specmin.setSuffix(" dB")

        self.spinBox_specmax = QtGui.QSpinBox(self)
        self.spinBox_specmax.setKeyboardTracking(False)
        self.spinBox_specmax.setMinimum(-200)
        self.spinBox_specmax.setMaximum(200)
        self.spinBox_specmax.setProperty("value", DEFAULT_SPEC_MAX)
        self.spinBox_specmax.setObjectName("spinBox_specmax")
        self.spinBox_specmax.setSuffix(" dB")

        self.comboBox_weighting = QtGui.QComboBox(self)
        self.comboBox_weighting.setObjectName("weighting")
        self.comboBox_weighting.addItem("None")
        self.comboBox_weighting.addItem("A")
        self.comboBox_weighting.addItem("B")
        self.comboBox_weighting.addItem("C")
        self.comboBox_weighting.setCurrentIndex(DEFAULT_WEIGHTING)

        self.checkBox_showFreqLabels = QtGui.QCheckBox(self)
        self.checkBox_showFreqLabels.setObjectName("showFreqLabels")
        self.checkBox_showFreqLabels.setChecked(DEFAULT_SHOW_FREQ_LABELS)

        self.formLayout.addRow("Measurement type:", self.comboBox_dual_channel)
        self.formLayout.addRow("FFT Size:", self.comboBox_fftsize)
        self.formLayout.addRow("Frequency scale:", self.comboBox_freqscale)
        self.formLayout.addRow("Min frequency:", self.spinBox_minfreq)
        self.formLayout.addRow("Max frequency:", self.spinBox_maxfreq)
        self.formLayout.addRow("Min:", self.spinBox_specmin)
        self.formLayout.addRow("Max:", self.spinBox_specmax)
        self.formLayout.addRow("Middle-ear weighting:",
                               self.comboBox_weighting)
        self.formLayout.addRow("Display max-frequency label:",
                               self.checkBox_showFreqLabels)

        self.setLayout(self.formLayout)

        self.connect(self.comboBox_dual_channel,
                     QtCore.SIGNAL('currentIndexChanged(int)'),
                     self.dualchannelchanged)
        self.connect(self.comboBox_fftsize,
                     QtCore.SIGNAL('currentIndexChanged(int)'),
                     self.fftsizechanged)
        self.connect(self.comboBox_freqscale,
                     QtCore.SIGNAL('currentIndexChanged(int)'),
                     self.freqscalechanged)
        self.connect(self.spinBox_minfreq, QtCore.SIGNAL('valueChanged(int)'),
                     self.parent().setminfreq)
        self.connect(self.spinBox_maxfreq, QtCore.SIGNAL('valueChanged(int)'),
                     self.parent().setmaxfreq)
        self.connect(self.spinBox_specmin, QtCore.SIGNAL('valueChanged(int)'),
                     self.parent().setmin)
        self.connect(self.spinBox_specmax, QtCore.SIGNAL('valueChanged(int)'),
                     self.parent().setmax)
        self.connect(self.comboBox_weighting,
                     QtCore.SIGNAL('currentIndexChanged(int)'),
                     self.parent().setweighting)
        self.connect(self.checkBox_showFreqLabels,
                     QtCore.SIGNAL('toggled(bool)'),
                     self.parent().setShowFreqLabel)
예제 #45
0
    def setupUi(self, Dialog):
        Dialog.setObjectName(_fromUtf8("Dialog"))
        Dialog.resize(1355, 696)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(Dialog.sizePolicy().hasHeightForWidth())
        Dialog.setSizePolicy(sizePolicy)
        Dialog.setFocusPolicy(QtCore.Qt.StrongFocus)
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(_fromUtf8(":/icon/Project/HeadlineMining Gitlab/images/icon.ico")),
                       QtGui.QIcon.Normal, QtGui.QIcon.Off)
        Dialog.setWindowIcon(icon)
        Dialog.setAutoFillBackground(False)
        Dialog.setStyleSheet(_fromUtf8("background-image: url(:/bavkground/images/woodback.jpg);"))

        # Graph
        pg.setConfigOption('background', 'w')
        pg.setConfigOption('foreground', 'k')
        pg.setConfigOption('leftButtonPan', False)
        self.Graph = PlotWidget(Dialog)
        self.Graph.setGeometry(QtCore.QRect(670, 30, 651, 321))
        self.Graph.setObjectName(_fromUtf8("Graph"))
        makeGraph(self.Graph)

        # Graph Label
        self.GraphLabel = QtGui.QLabel(Dialog)
        self.GraphLabel.setGeometry(QtCore.QRect(670, 1, 651, 28))
        self.GraphLabel.setAutoFillBackground(False)
        self.GraphLabel.setStyleSheet(_fromUtf8("background:transparent;"))
        self.GraphLabel.setFrameShadow(QtGui.QFrame.Plain)
        self.GraphLabel.setText(_fromUtf8(
            "<html><head/><body><p align=\"center\"><span style=\" font-size:12pt; font-weight:600; color:#fff2af;\"><u>Opinion Graph Of Headlines</u></span></p></body></html>"))
        self.GraphLabel.setTextFormat(QtCore.Qt.RichText)
        self.GraphLabel.setAlignment(QtCore.Qt.AlignCenter)
        self.GraphLabel.setWordWrap(True)
        self.GraphLabel.setTextInteractionFlags(QtCore.Qt.NoTextInteraction)
        self.GraphLabel.setObjectName(_fromUtf8("GraphLabel"))

        # wordCloud
        self.wordCloud = pic = QtGui.QLabel(Dialog)
        self.wordCloud.setGeometry(QtCore.QRect(40, 30, 560, 321))
        self.wordCloud.setObjectName(_fromUtf8("wordCloud"))
        drawWordCloud()
        self.wordCloud.setPixmap(QtGui.QPixmap("./data/wc.png"))
        # self.wordCloud.setPixmap(QtGui.QPixmap("../data/wc.png")) #testing

        # WordCloud Label
        self.WordCloudLabel = QtGui.QLabel(Dialog)
        self.WordCloudLabel.setGeometry(QtCore.QRect(40, 1, 560, 28))
        self.WordCloudLabel.setAutoFillBackground(False)
        self.WordCloudLabel.setStyleSheet(_fromUtf8("background:transparent;"))
        self.WordCloudLabel.setFrameShadow(QtGui.QFrame.Plain)
        self.WordCloudLabel.setText(_fromUtf8(
            "<html><head/><body><p align=\"center\"><span style=\" font-size:12pt; font-weight:600; color:#fff2af;\">\
            <u>Hot Topics Based On Usage Frequency In Headlines</u></span></p></body></html>"))
        self.WordCloudLabel.setTextFormat(QtCore.Qt.RichText)
        self.WordCloudLabel.setAlignment(QtCore.Qt.AlignCenter)
        self.WordCloudLabel.setWordWrap(True)
        self.WordCloudLabel.setTextInteractionFlags(QtCore.Qt.NoTextInteraction)
        self.WordCloudLabel.setObjectName(_fromUtf8("WordCloudLabel"))

        # Calender
        self.calendarWidget = QtGui.QCalendarWidget(Dialog)
        self.calendarWidget.setGeometry(QtCore.QRect(830, 430, 361, 251))
        self.calendarWidget.setMinimumDate(QtCore.QDate(2017, 1, 2))
        self.calendarWidget.setMaximumDate(QtCore.QDate(2017, 12, 31))
        self.calendarWidget.setObjectName(_fromUtf8("calendarWidget"))
        self.calendarWidget.clicked.connect(self.dateSelected)

        # Calender Label
        self.CalenderLabel = QtGui.QLabel(Dialog)
        self.CalenderLabel.setGeometry(QtCore.QRect(760, 370, 491, 51))
        self.CalenderLabel.setAutoFillBackground(False)
        self.CalenderLabel.setStyleSheet(_fromUtf8("background:transparent;"))
        self.CalenderLabel.setFrameShadow(QtGui.QFrame.Plain)
        self.CalenderLabel.setText(_fromUtf8(
            "<html><head/><body><p align=\"center\"><span style=\" font-size:12pt; font-weight:600; color:#fff2af;\"><u>Select a date from calender below to change day</u></span></p></body></html>"))
        self.CalenderLabel.setTextFormat(QtCore.Qt.RichText)
        self.CalenderLabel.setAlignment(QtCore.Qt.AlignCenter)
        self.CalenderLabel.setWordWrap(True)
        self.CalenderLabel.setTextInteractionFlags(QtCore.Qt.NoTextInteraction)
        self.CalenderLabel.setObjectName(_fromUtf8("CalenderLabel"))

        # Nextbutton
        self.pushButton = QtGui.QPushButton(Dialog)
        self.pushButton.setGeometry(QtCore.QRect(670, 490, 81, 81))
        self.pushButton.setStyleSheet(_fromUtf8("background-image: url(:/labelBackground/images/nextButton.png);\n"
                                                "border:none;"))
        self.pushButton.setAutoDefault(True)
        self.pushButton.isCheckable()
        self.pushButton.setDefault(False)
        self.pushButton.setFlat(False)
        self.pushButton.setObjectName(_fromUtf8("pushButton"))
        self.pushButton.clicked.connect(self.nextFourHeadlines)

        # WeeklyButton
        self.weekButton = QtGui.QPushButton(Dialog)
        self.weekButton.setGeometry(QtCore.QRect(1210, 490, 130, 81))
        self.weekButton.setStyleSheet(_fromUtf8("color:white; font-size:14pt; font-weight:600; background:grey; \
                                                 font-family:'Lucida Calligraphy';border-style: outset;\
                                                 border-width: 2px;border-radius: 15px;border-color: black;\
                                                padding: 4px;"))
        self.weekButton.setAutoDefault(True)
        self.weekButton.isCheckable()
        self.weekButton.setText("One Week \nAnalysis")
        self.weekButton.setObjectName(_fromUtf8("weekButton"))
        self.weekButton.clicked.connect(self.oneWeekAnalysis)

        # Calculate accuracy button
        self.accuracyButton = QtGui.QPushButton(Dialog)
        self.accuracyButton.setGeometry(QtCore.QRect(1210, 591, 130, 81))
        self.accuracyButton.setStyleSheet(_fromUtf8("color:white; font-size:14pt; font-weight:600; background:grey; \
                                                         font-family:'Lucida Calligraphy';border-style: outset;\
                                                         border-width: 2px;border-radius: 15px;border-color: black;\
                                                        padding: 4px;"))
        self.accuracyButton.setAutoDefault(True)
        self.accuracyButton.isCheckable()
        self.accuracyButton.setText("Calculate \n Accuracy ")
        self.accuracyButton.setObjectName(_fromUtf8("accuracyButton"))
        self.accuracyButton.clicked.connect(self.calcuateAccuracy)

        # Accuracy instruction label
        self.accuracyLabel = QtGui.QLabel(Dialog)
        self.accuracyLabel.setGeometry(QtCore.QRect(30, 370, 521, 28))
        self.accuracyLabel.setAutoFillBackground(False)
        self.accuracyLabel.setStyleSheet(_fromUtf8("background:transparent;"))
        self.accuracyLabel.setFrameShadow(QtGui.QFrame.Plain)
        self.accuracyLabel.setText(_fromUtf8(
            "<html><head/><body><p align=\"center\"><span style=\" font-size:12pt; font-weight:600; color: #20ee94;\">\
            <u>Cycle through all headlines and select incorrect scores</u></span></p></body></html>"))
        self.accuracyLabel.setTextFormat(QtCore.Qt.RichText)
        self.accuracyLabel.setAlignment(QtCore.Qt.AlignCenter)
        self.accuracyLabel.setWordWrap(True)
        self.accuracyLabel.setTextInteractionFlags(QtCore.Qt.NoTextInteraction)
        self.accuracyLabel.setObjectName(_fromUtf8("accuracyLabel"))
        self.accuracyLabel.hide()

        # AccuracyResult Label
        self.accuracyResultLabel = QtGui.QLabel(Dialog)
        self.accuracyResultLabel.setGeometry(QtCore.QRect(645, 591, 150, 100))  # 670, 490, 81, 81
        self.accuracyResultLabel.setAutoFillBackground(False)
        self.accuracyResultLabel.setStyleSheet(_fromUtf8("background:transparent;"))
        self.accuracyResultLabel.setFrameShadow(QtGui.QFrame.Plain)
        self.accuracyResultLabel.setTextFormat(QtCore.Qt.RichText)
        self.accuracyResultLabel.setAlignment(QtCore.Qt.AlignCenter)
        self.accuracyResultLabel.setWordWrap(True)
        self.accuracyResultLabel.setTextInteractionFlags(QtCore.Qt.NoTextInteraction)
        self.accuracyResultLabel.setObjectName(_fromUtf8("accuracyResultLabel"))
        self.accuracyResultLabel.hide()

        # checkboxes
        self.checkBox1 = QtGui.QCheckBox(Dialog)
        self.checkBox1.setGeometry(QtCore.QRect(15, 408, 16, 17))
        self.checkBox1.setText(_fromUtf8(""))
        self.checkBox1.setObjectName(_fromUtf8("checkBox1"))
        self.checkBox1.hide()

        self.checkBox2 = QtGui.QCheckBox(Dialog)
        self.checkBox2.setGeometry(QtCore.QRect(15, 488, 16, 17))
        self.checkBox2.setText(_fromUtf8(""))
        self.checkBox2.setObjectName(_fromUtf8("checkBox2"))
        self.checkBox2.hide()

        self.checkBox3 = QtGui.QCheckBox(Dialog)
        self.checkBox3.setGeometry(QtCore.QRect(15, 568, 16, 17))
        self.checkBox3.setText(_fromUtf8(""))
        self.checkBox3.setObjectName(_fromUtf8("checkBox3"))
        self.checkBox3.hide()

        self.checkBox4 = QtGui.QCheckBox(Dialog)
        self.checkBox4.setGeometry(QtCore.QRect(15, 648, 16, 17))
        self.checkBox4.setText(_fromUtf8(""))
        self.checkBox4.setObjectName(_fromUtf8("checkBox4"))
        self.checkBox4.hide()

        # Headline labels
        self.Headline1 = QtGui.QLabel(Dialog)
        self.Headline1.setGeometry(QtCore.QRect(40, 392, 521, 51))
        self.Headline1.setStyleSheet(_fromUtf8("background:transparent;"))
        self.Headline1.setTextFormat(QtCore.Qt.RichText)
        self.Headline1.setAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignCenter | QtCore.Qt.AlignHCenter)
        self.Headline1.setWordWrap(True)
        self.Headline1.setTextInteractionFlags(QtCore.Qt.NoTextInteraction)
        self.Headline1.setObjectName(_fromUtf8("Headline1"))

        self.Headline2 = QtGui.QLabel(Dialog)
        self.Headline2.setGeometry(QtCore.QRect(40, 472, 521, 51))
        self.Headline2.setStyleSheet(_fromUtf8("background:transparent;"))
        self.Headline2.setTextFormat(QtCore.Qt.RichText)
        self.Headline2.setAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignCenter | QtCore.Qt.AlignHCenter)
        self.Headline2.setWordWrap(True)
        self.Headline2.setTextInteractionFlags(QtCore.Qt.NoTextInteraction)
        self.Headline2.setObjectName(_fromUtf8("Headline2"))

        self.Headline3 = QtGui.QLabel(Dialog)
        self.Headline3.setGeometry(QtCore.QRect(40, 552, 521, 51))
        self.Headline3.setStyleSheet(_fromUtf8("background:transparent;"))
        self.Headline3.setTextFormat(QtCore.Qt.RichText)
        self.Headline3.setAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignCenter | QtCore.Qt.AlignHCenter)
        self.Headline3.setWordWrap(True)
        self.Headline3.setTextInteractionFlags(QtCore.Qt.NoTextInteraction)
        self.Headline3.setObjectName(_fromUtf8("Headline3"))

        self.Headline4 = QtGui.QLabel(Dialog)
        self.Headline4.setGeometry(QtCore.QRect(40, 632, 521, 51))
        self.Headline4.setStyleSheet(_fromUtf8("background:transparent;"))
        self.Headline4.setTextFormat(QtCore.Qt.RichText)
        self.Headline4.setAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignCenter | QtCore.Qt.AlignHCenter)
        self.Headline4.setWordWrap(True)
        self.Headline4.setTextInteractionFlags(QtCore.Qt.NoTextInteraction)
        self.Headline4.setObjectName(_fromUtf8("Headline4"))

        # Score Labels
        self.Value4 = QtGui.QLabel(Dialog)
        self.Value4.setGeometry(QtCore.QRect(580, 632, 71, 51))
        self.Value4.setStyleSheet(_fromUtf8("background:transparent;"))
        self.Value4.setTextFormat(QtCore.Qt.RichText)
        self.Value4.setAlignment(QtCore.Qt.AlignCenter | QtCore.Qt.AlignLeft)
        self.Value4.setTextInteractionFlags(QtCore.Qt.NoTextInteraction)
        self.Value4.setObjectName(_fromUtf8("Value4"))

        self.Value3 = QtGui.QLabel(Dialog)
        self.Value3.setGeometry(QtCore.QRect(580, 552, 71, 51))
        self.Value3.setStyleSheet(_fromUtf8("background:transparent;"))
        self.Value3.setTextFormat(QtCore.Qt.RichText)
        self.Value3.setAlignment(QtCore.Qt.AlignCenter | QtCore.Qt.AlignLeft)
        self.Value3.setTextInteractionFlags(QtCore.Qt.NoTextInteraction)
        self.Value3.setObjectName(_fromUtf8("Value3"))

        self.Value2 = QtGui.QLabel(Dialog)
        self.Value2.setGeometry(QtCore.QRect(580, 472, 71, 51))
        self.Value2.setStyleSheet(_fromUtf8("background:transparent;"))
        self.Value2.setTextFormat(QtCore.Qt.RichText)
        self.Value2.setAlignment(QtCore.Qt.AlignCenter | QtCore.Qt.AlignLeft)
        self.Value2.setTextInteractionFlags(QtCore.Qt.NoTextInteraction)
        self.Value2.setObjectName(_fromUtf8("Value2"))

        self.Value1 = QtGui.QLabel(Dialog)
        self.Value1.setGeometry(QtCore.QRect(580, 392, 71, 51))
        self.Value1.setStyleSheet(_fromUtf8("background:transparent;"))
        self.Value1.setTextFormat(QtCore.Qt.RichText)
        self.Value1.setAlignment(QtCore.Qt.AlignCenter | QtCore.Qt.AlignLeft)
        self.Value1.setTextInteractionFlags(QtCore.Qt.NoTextInteraction)
        self.Value1.setObjectName(_fromUtf8("Value1"))

        self.retranslateUi(Dialog)
        QtCore.QMetaObject.connectSlotsByName(Dialog)
예제 #46
0
파일: qtplot.py 프로젝트: cover-me/qtplot
    def init_ui(self):
        self.setWindowTitle('qtplot')

        self.main_widget = QtGui.QTabWidget(self)

        self.view_widget = QtGui.QWidget()
        self.main_widget.addTab(self.view_widget, 'View')
        self.export_widget = ExportWidget(self)
        self.main_widget.addTab(self.export_widget, 'Export')

        self.canvas = Canvas(self)

        # path
        hbox = QtGui.QHBoxLayout()

        lbl_folder = QtGui.QLabel('Path:')
        hbox.addWidget(lbl_folder)

        self.le_path = QtGui.QLineEdit(self)
        self.le_path.returnPressed.connect(self.on_refresh)
        hbox.addWidget(self.le_path)

        # Top row buttons
        hbox2 = QtGui.QHBoxLayout()

        self.b_load = QtGui.QPushButton('Load..')
        self.b_load.clicked.connect(self.on_load_dat)
        hbox.addWidget(self.b_load)

        self.b_refresh = QtGui.QPushButton('Refresh')
        self.b_refresh.clicked.connect(self.on_refresh)
        hbox.addWidget(self.b_refresh)

        self.b_swap_axes = QtGui.QPushButton('Swap XY', self)
        self.b_swap_axes.clicked.connect(self.on_swap_axes)
        hbox2.addWidget(self.b_swap_axes)

        self.b_linecut = QtGui.QPushButton('Linecut')
        self.b_linecut.clicked.connect(self.linecut.show_window)
        hbox2.addWidget(self.b_linecut)

        self.b_operations = QtGui.QPushButton('Operations')
        self.b_operations.clicked.connect(self.operations.show_window)
        hbox2.addWidget(self.b_operations)

        # Subtracting series R
        r_hbox = QtGui.QHBoxLayout()

        lbl_v = QtGui.QLabel('V-I-R:')
        r_hbox.addWidget(lbl_v)

        self.cb_v = QtGui.QComboBox(self)
        self.cb_v.setMaxVisibleItems(25)
        self.cb_v.setMinimumContentsLength(3)
        self.cb_v.setSizePolicy(
            QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,
                              QtGui.QSizePolicy.Fixed))
        r_hbox.addWidget(self.cb_v)

        self.cb_i = QtGui.QComboBox(self)
        self.cb_i.setMaxVisibleItems(25)
        self.cb_i.setMinimumContentsLength(3)
        self.cb_i.setSizePolicy(
            QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,
                              QtGui.QSizePolicy.Fixed))
        r_hbox.addWidget(self.cb_i)

        self.le_r = QtGui.QLineEdit(self)
        self.le_r.returnPressed.connect(self.on_sub_series_r)
        self.le_r.setMaximumWidth(30)
        r_hbox.addWidget(self.le_r)

        self.b_ok = QtGui.QPushButton('Sub', self)
        self.b_ok.setToolTip('Subtract series R')
        self.b_ok.setMaximumWidth(30)
        self.b_ok.clicked.connect(self.on_sub_series_r)
        r_hbox.addWidget(self.b_ok)

        lbl_a3 = QtGui.QLabel('A3:')
        r_hbox.addWidget(lbl_a3)

        self.cb_a3 = QtGui.QComboBox(self)
        self.cb_a3.setToolTip('The 3rd axis')
        self.cb_a3.setMinimumContentsLength(3)
        # self.cb_a3.setSizePolicy(QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Fixed))
        r_hbox.addWidget(self.cb_a3)

        self.le_a3index = QtGui.QLineEdit(self)
        self.le_a3index.setText('0')
        self.le_a3index.setToolTip('Index')
        self.le_a3index.setMaximumWidth(15)
        self.le_a3index.setValidator(QtGui.QIntValidator(0, 0))
        self.le_a3index.returnPressed.connect(self.on_refresh)
        r_hbox.addWidget(self.le_a3index)

        # Selecting columns and orders
        grid = QtGui.QGridLayout()

        lbl_x = QtGui.QLabel("X:", self)
        lbl_x.setMaximumWidth(10)
        grid.addWidget(lbl_x, 1, 1)

        self.cb_x = QtGui.QComboBox(self)
        self.cb_x.activated.connect(self.on_data_change)
        self.cb_x.setMaxVisibleItems(25)
        grid.addWidget(self.cb_x, 1, 2)

        lbl_y = QtGui.QLabel("Y:", self)
        grid.addWidget(lbl_y, 2, 1)

        self.cb_y = QtGui.QComboBox(self)
        self.cb_y.activated.connect(self.on_data_change)
        self.cb_y.setMaxVisibleItems(25)
        grid.addWidget(self.cb_y, 2, 2)

        lbl_d = QtGui.QLabel("Data:", self)
        grid.addWidget(lbl_d, 3, 1)

        self.cb_z = QtGui.QComboBox(self)
        self.cb_z.activated.connect(self.on_data_change)
        self.cb_z.setMaxVisibleItems(25)
        grid.addWidget(self.cb_z, 3, 2)

        self.combo_boxes = [
            self.cb_v, self.cb_i, self.cb_x, self.cb_y, self.cb_z, self.cb_a3
        ]

        # Colormap
        hbox_gamma1 = QtGui.QHBoxLayout()
        hbox_gamma2 = QtGui.QHBoxLayout()
        hbox_gamma3 = QtGui.QHBoxLayout()

        # Reset colormap button
        self.cb_reset_cmap = QtGui.QCheckBox('Auto reset')
        self.cb_reset_cmap.setCheckState(QtCore.Qt.Checked)
        hbox_gamma1.addWidget(self.cb_reset_cmap)

        # Colormap combobox
        self.cb_cmaps = QtGui.QComboBox(self)
        self.cb_cmaps.setMinimumContentsLength(5)
        self.cb_cmaps.activated.connect(self.on_cmap_change)
        path = os.path.dirname(os.path.realpath(__file__))

        path = os.path.join(path, 'colormaps')

        cmap_files = []
        for dir, _, files in os.walk(path):
            for filename in files:
                reldir = os.path.relpath(dir, path)
                relfile = os.path.join(reldir, filename)

                # Remove .\ for files in the root of the directory
                if relfile[:2] == '.\\':
                    relfile = relfile[2:]

                cmap_files.append(relfile)

        self.cb_cmaps.addItems(cmap_files)
        self.cb_cmaps.setMaxVisibleItems(25)

        hbox_gamma1.addWidget(self.cb_cmaps)

        # Colormap minimum text box
        hbox_gamma2.addWidget(QtGui.QLabel('Min:'))
        self.le_min = QtGui.QLineEdit(self)
        # self.le_min.setMaximumWidth(80)
        self.le_min.returnPressed.connect(self.on_min_max_entered)
        hbox_gamma2.addWidget(self.le_min)

        # Colormap minimum slider
        self.s_min = QtGui.QSlider(QtCore.Qt.Horizontal)
        # self.s_min.setMaximum(100)
        self.s_min.sliderMoved.connect(self.on_min_changed)
        hbox_gamma3.addWidget(self.s_min)

        # Gamma text box
        hbox_gamma2.addWidget(QtGui.QLabel('G:'))
        self.le_gamma = QtGui.QLineEdit(self)
        # self.le_gamma.setMaximumWidth(80)
        self.le_gamma.returnPressed.connect(self.on_le_gamma_entered)
        hbox_gamma2.addWidget(self.le_gamma)

        # Colormap gamma slider
        self.s_gamma = QtGui.QSlider(QtCore.Qt.Horizontal)
        self.s_gamma.setMinimum(-100)
        # self.s_gamma.setMaximum(100)
        self.s_gamma.setValue(0)
        self.s_gamma.valueChanged.connect(self.on_gamma_changed)
        hbox_gamma3.addWidget(self.s_gamma)

        # Colormap maximum text box
        hbox_gamma2.addWidget(QtGui.QLabel('Max:'))
        self.le_max = QtGui.QLineEdit(self)
        # self.le_max.setMaximumWidth(80)
        self.le_max.returnPressed.connect(self.on_min_max_entered)
        hbox_gamma2.addWidget(self.le_max)

        # Colormap maximum slider
        self.s_max = QtGui.QSlider(QtCore.Qt.Horizontal)
        # self.s_max.setMaximum(100)
        self.s_max.setValue(self.s_max.maximum())
        self.s_max.sliderMoved.connect(self.on_max_changed)
        hbox_gamma3.addWidget(self.s_max)

        self.b_reset = QtGui.QPushButton('Reset')
        self.b_reset.setMinimumWidth(50)
        self.b_reset.clicked.connect(self.on_cm_reset)
        hbox_gamma1.addWidget(self.b_reset)

        # Bottom row buttons
        self.b_settings = QtGui.QPushButton('Settings')
        self.b_settings.clicked.connect(self.settings.show_window)
        hbox2.addWidget(self.b_settings)

        self.b_save_matrix = QtGui.QPushButton('Save data')
        self.b_save_matrix.clicked.connect(self.on_save_matrix)
        hbox2.addWidget(self.b_save_matrix)

        for i in range(hbox2.count()):
            w = hbox2.itemAt(i).widget()
            if isinstance(w, QtGui.QPushButton):
                w.setMinimumWidth(50)

        # Main box
        vbox = QtGui.QVBoxLayout(self.view_widget)
        vbox.addWidget(self.canvas.native)
        vbox2 = QtGui.QVBoxLayout()
        vbox2.addLayout(hbox)
        vbox2.addLayout(hbox2)
        vbox2.addLayout(r_hbox)
        vbox2.addLayout(grid)
        vbox2.addLayout(hbox_gamma1)
        vbox2.addLayout(hbox_gamma2)
        vbox2.addLayout(hbox_gamma3)
        s_widget = QtGui.QWidget()
        s_widget.setLayout(vbox2)
        s_area = QtGui.QScrollArea()
        s_area.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
        s_area.setFixedHeight(s_widget.sizeHint().height())
        s_area.setFrameStyle(QtGui.QScrollArea.NoFrame)
        s_area.setWidgetResizable(True)
        s_area.setWidget(s_widget)
        vbox.addWidget(s_area)

        self.status_bar = QtGui.QStatusBar()
        self.l_position = QtGui.QLabel('(x, y)')
        self.l_position.setTextInteractionFlags(
            QtCore.Qt.TextSelectableByMouse
            | QtCore.Qt.TextSelectableByKeyboard)
        self.status_bar.addWidget(self.l_position, 1)

        self.l_linepos = QtGui.QLabel('')
        self.l_linepos.setTextInteractionFlags(
            QtCore.Qt.TextSelectableByMouse
            | QtCore.Qt.TextSelectableByKeyboard)
        self.l_linepos.setToolTip('Linecut position. [x1,y1],[x2,y2] or so')
        self.status_bar.addWidget(self.l_linepos)

        self.l_slope = QtGui.QLabel('k')
        self.l_slope.setTextInteractionFlags(
            QtCore.Qt.TextSelectableByMouse
            | QtCore.Qt.TextSelectableByKeyboard)
        self.l_slope.setToolTip('Linecut slope')
        self.status_bar.addWidget(self.l_slope)
        self.load_time = QtGui.QLabel('t (t_max)')
        self.load_time.setToolTip('Loading time (max loading time) in ms')
        self.status_bar.addWidget(self.load_time)
        self.status_bar.setMinimumWidth(50)
        self.setStatusBar(self.status_bar)

        self.main_widget.setFocus()
        self.setCentralWidget(self.main_widget)

        self.setAcceptDrops(True)

        self.resize(500, 800)
        self.move(200, 100)
        self.show()
        self.linecut.resize(520, 400)
        self.linecut.move(self.width() + 220, 100)
        self.operations.resize(400, 200)
        self.operations.move(self.width() + 220, 540)
        self.linecut.show()
        self.operations.show()
예제 #47
0
    def getfiles(self):
        filter = "Wav File (*.wav)"
        dlg = QFileDialog(self,'Audio Files','~/Music/', filter)
        dlg.setFileMode(QtGui.QFileDialog.DirectoryOnly)
        dlg.setFilter("Audio files (*.wav)")
        filenames = QStringList()
        self.comboBox1.clear()
        self.dir_files=[]
        self.dirs=[]
        #self.run_enh.setEnabled(False)
        #self.comboBox2.setEnabled(False)
        if dlg.exec_():
            filenames = dlg.selectedFiles()
            #f = open(filenames[0], 'r')
            #print(filenames[0])
            #self.l2.setText(filenames[0])
            #self.l2.move(10,200)
            files_o = sorted(os.listdir(filenames[0]))
            count = 0
            self.dirs.append(str(filenames[0]))
            ind = []
            global dirs
            dirs = self.dirs
            for index in files_o:

                if index.find('Close') != -1 :
                    self.comboBox1.addItem(index)
                elif index.find('CH') == -1 :
                    continue
                else:
                    ind.append(index)
                    self.dir_files.append(os.path.join(str(filenames[0]),index))
                    self.comboBox1.addItem(index)
                    count +=1
            str_d = 'Total number of channels are ' + str(count)
            self.noc.setText(str_d)
            self.noc.setStyleSheet('color: red ')
            self.noc.setFont(QtGui.QFont("Times", 12, QtGui.QFont.Bold))
            self.noc.resize(self.noc.sizeHint())
            #if count==4:
                #print(ind[0])
            #    self.l2.setText(ind[0]); self.l3.setText(ind[1]);self.l4.setText(ind[2]);self.l5.setText(ind[3])
            #    self.l2.resize(self.l2.sizeHint())
            #    self.l3.resize(self.l3.sizeHint())
            #    self.l4.resize(self.l4.sizeHint())
            #    self.l5.resize(self.l5.sizeHint())
            #    self.l2_puss.resize(60,20)
            #    self.l3_puss.resize(60,20)
            #    self.l4_puss.resize(60,20)
            #    self.l5_puss.resize(60,20)
            #    self.l2_puss.show()
            #    self.l3_puss.show()
            #    self.l4_puss.show()
            #    self.l5_puss.show()
            #    self.l2_asr.resize(60,20)
            #    self.l3_asr.resize(60,20)
            #    self.l4_asr.resize(60,20)
            #    self.l5_asr.resize(60,20)
            #    self.l2_asr.show()
            #    self.l3_asr.show()
            #    self.l4_asr.show()
            #    self.l5_asr.show()
            self.comboBox1.show()
            self.puss.show()
            self.dec.show()
            self.comboBox2.setEnabled(True)
            self.run_enh.setEnabled(True)
            self.wer1.hide()
            self.wer2.hide()
            self.log1.hide()
            self.log2.hide()
            self.l9.hide()
            self.textbox.hide()
            self.puss_enh.hide()
예제 #48
0
def main():
    app = QtGui.QApplication(sys.argv)
    widget = GUIVertical()
    widget.show()
    app.exec_()
예제 #49
0
    def setupUi(self, Dialog):
        Dialog.setObjectName(_fromUtf8("Dialog"))
        Dialog.resize(860, 694)
        self.gridLayout_2 = QtGui.QGridLayout(Dialog)
        self.gridLayout_2.setMargin(3)
        self.gridLayout_2.setSpacing(3)
        self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2"))
        self.verticalLayout_7 = QtGui.QVBoxLayout()
        self.verticalLayout_7.setObjectName(_fromUtf8("verticalLayout_7"))
        self.horizontalLayout_22 = QtGui.QHBoxLayout()
        self.horizontalLayout_22.setObjectName(
            _fromUtf8("horizontalLayout_22"))
        self.label = QtGui.QLabel(Dialog)
        self.label.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.label.setObjectName(_fromUtf8("label"))
        self.horizontalLayout_22.addWidget(self.label)
        spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding,
                                       QtGui.QSizePolicy.Minimum)
        self.horizontalLayout_22.addItem(spacerItem)
        self.selectButton = QtGui.QPushButton(Dialog)
        self.selectButton.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.selectButton.setObjectName(_fromUtf8("selectButton"))
        self.horizontalLayout_22.addWidget(self.selectButton)
        self.verticalLayout_7.addLayout(self.horizontalLayout_22)
        self.listWidget = QtGui.QListWidget(Dialog)
        self.listWidget.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.listWidget.setObjectName(_fromUtf8("listWidget"))
        self.verticalLayout_7.addWidget(self.listWidget)
        self.horizontalLayout_15 = QtGui.QHBoxLayout()
        self.horizontalLayout_15.setObjectName(
            _fromUtf8("horizontalLayout_15"))
        self.countLabel = QtGui.QLabel(Dialog)
        self.countLabel.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.countLabel.setObjectName(_fromUtf8("countLabel"))
        self.horizontalLayout_15.addWidget(self.countLabel)
        spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding,
                                        QtGui.QSizePolicy.Minimum)
        self.horizontalLayout_15.addItem(spacerItem1)
        self.deleteButton = QtGui.QPushButton(Dialog)
        self.deleteButton.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.deleteButton.setObjectName(_fromUtf8("deleteButton"))
        self.horizontalLayout_15.addWidget(self.deleteButton)
        self.verticalLayout_7.addLayout(self.horizontalLayout_15)
        self.gridLayout_2.addLayout(self.verticalLayout_7, 0, 0, 1, 1)
        self.dockWidget = QtGui.QDockWidget(Dialog)
        self.dockWidget.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.dockWidget.setObjectName(_fromUtf8("dockWidget"))
        self.dockWidgetContents = QtGui.QWidget()
        self.dockWidgetContents.setObjectName(_fromUtf8("dockWidgetContents"))
        self.gridLayout_6 = QtGui.QGridLayout(self.dockWidgetContents)
        self.gridLayout_6.setMargin(0)
        self.gridLayout_6.setSpacing(0)
        self.gridLayout_6.setObjectName(_fromUtf8("gridLayout_6"))
        self.consoleEdit = QtGui.QPlainTextEdit(self.dockWidgetContents)
        self.consoleEdit.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.consoleEdit.setFrameShape(QtGui.QFrame.NoFrame)
        self.consoleEdit.setFrameShadow(QtGui.QFrame.Raised)
        self.consoleEdit.setLineWrapMode(QtGui.QPlainTextEdit.WidgetWidth)
        self.consoleEdit.setReadOnly(True)
        self.consoleEdit.setObjectName(_fromUtf8("consoleEdit"))
        self.gridLayout_6.addWidget(self.consoleEdit, 0, 0, 1, 1)
        self.dockWidget.setWidget(self.dockWidgetContents)
        self.gridLayout_2.addWidget(self.dockWidget, 1, 0, 1, 2)
        self.verticalLayout_8 = QtGui.QVBoxLayout()
        self.verticalLayout_8.setObjectName(_fromUtf8("verticalLayout_8"))
        self.horizontalLayout = QtGui.QHBoxLayout()
        self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
        self.label_2 = QtGui.QLabel(Dialog)
        self.label_2.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.horizontalLayout.addWidget(self.label_2)
        self.offsetEdit = QtGui.QLineEdit(Dialog)
        self.offsetEdit.setEnabled(True)
        self.offsetEdit.setMinimumSize(QtCore.QSize(0, 0))
        self.offsetEdit.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.offsetEdit.setReadOnly(True)
        self.offsetEdit.setObjectName(_fromUtf8("offsetEdit"))
        self.horizontalLayout.addWidget(self.offsetEdit)
        self.offsetButton = QtGui.QToolButton(Dialog)
        self.offsetButton.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.offsetButton.setText(_fromUtf8(""))
        self.offsetButton.setObjectName(_fromUtf8("offsetButton"))
        self.horizontalLayout.addWidget(self.offsetButton)
        self.verticalLayout_8.addLayout(self.horizontalLayout)
        self.horizontalLayout_11 = QtGui.QHBoxLayout()
        self.horizontalLayout_11.setObjectName(
            _fromUtf8("horizontalLayout_11"))
        self.verticalLayout_5 = QtGui.QVBoxLayout()
        self.verticalLayout_5.setObjectName(_fromUtf8("verticalLayout_5"))
        self.outlierGroup = QtGui.QGroupBox(Dialog)
        self.outlierGroup.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.outlierGroup.setFlat(False)
        self.outlierGroup.setCheckable(True)
        self.outlierGroup.setObjectName(_fromUtf8("outlierGroup"))
        self.gridLayout_4 = QtGui.QGridLayout(self.outlierGroup)
        self.gridLayout_4.setObjectName(_fromUtf8("gridLayout_4"))
        self.horizontalLayout_8 = QtGui.QHBoxLayout()
        self.horizontalLayout_8.setObjectName(_fromUtf8("horizontalLayout_8"))
        self.label_7 = QtGui.QLabel(self.outlierGroup)
        self.label_7.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.label_7.setObjectName(_fromUtf8("label_7"))
        self.horizontalLayout_8.addWidget(self.label_7)
        spacerItem2 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding,
                                        QtGui.QSizePolicy.Minimum)
        self.horizontalLayout_8.addItem(spacerItem2)
        self.iqrWindowBox = QtGui.QSpinBox(self.outlierGroup)
        self.iqrWindowBox.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.iqrWindowBox.setMaximum(9999)
        self.iqrWindowBox.setProperty("value", 365)
        self.iqrWindowBox.setObjectName(_fromUtf8("iqrWindowBox"))
        self.horizontalLayout_8.addWidget(self.iqrWindowBox)
        self.gridLayout_4.addLayout(self.horizontalLayout_8, 2, 0, 1, 1)
        self.horizontalLayout_6 = QtGui.QHBoxLayout()
        self.horizontalLayout_6.setObjectName(_fromUtf8("horizontalLayout_6"))
        self.label_5 = QtGui.QLabel(self.outlierGroup)
        self.label_5.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.label_5.setObjectName(_fromUtf8("label_5"))
        self.horizontalLayout_6.addWidget(self.label_5)
        spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding,
                                        QtGui.QSizePolicy.Minimum)
        self.horizontalLayout_6.addItem(spacerItem3)
        self.sigmaEdit = QtGui.QLineEdit(self.outlierGroup)
        self.sigmaEdit.setMaximumSize(QtCore.QSize(80, 16777215))
        self.sigmaEdit.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.sigmaEdit.setLayoutDirection(QtCore.Qt.LeftToRight)
        self.sigmaEdit.setInputMask(_fromUtf8(""))
        self.sigmaEdit.setObjectName(_fromUtf8("sigmaEdit"))
        self.horizontalLayout_6.addWidget(self.sigmaEdit)
        self.gridLayout_4.addLayout(self.horizontalLayout_6, 0, 0, 1, 1)
        self.verticalLayout_2 = QtGui.QVBoxLayout()
        self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2"))
        self.label_19 = QtGui.QLabel(self.outlierGroup)
        self.label_19.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.label_19.setObjectName(_fromUtf8("label_19"))
        self.verticalLayout_2.addWidget(self.label_19)
        self.horizontalLayout_4 = QtGui.QHBoxLayout()
        self.horizontalLayout_4.setObjectName(_fromUtf8("horizontalLayout_4"))
        self.outlierDirEdit = QtGui.QLineEdit(self.outlierGroup)
        self.outlierDirEdit.setEnabled(True)
        self.outlierDirEdit.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.outlierDirEdit.setReadOnly(True)
        self.outlierDirEdit.setObjectName(_fromUtf8("outlierDirEdit"))
        self.horizontalLayout_4.addWidget(self.outlierDirEdit)
        self.outlierDirButton = QtGui.QToolButton(self.outlierGroup)
        self.outlierDirButton.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.outlierDirButton.setText(_fromUtf8(""))
        self.outlierDirButton.setObjectName(_fromUtf8("outlierDirButton"))
        self.horizontalLayout_4.addWidget(self.outlierDirButton)
        self.verticalLayout_2.addLayout(self.horizontalLayout_4)
        self.gridLayout_4.addLayout(self.verticalLayout_2, 3, 0, 1, 1)
        self.horizontalLayout_7 = QtGui.QHBoxLayout()
        self.horizontalLayout_7.setObjectName(_fromUtf8("horizontalLayout_7"))
        self.label_6 = QtGui.QLabel(self.outlierGroup)
        self.label_6.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.label_6.setObjectName(_fromUtf8("label_6"))
        self.horizontalLayout_7.addWidget(self.label_6)
        spacerItem4 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding,
                                        QtGui.QSizePolicy.Minimum)
        self.horizontalLayout_7.addItem(spacerItem4)
        self.iqrBox = QtGui.QSpinBox(self.outlierGroup)
        self.iqrBox.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.iqrBox.setMaximum(5)
        self.iqrBox.setProperty("value", 1)
        self.iqrBox.setObjectName(_fromUtf8("iqrBox"))
        self.horizontalLayout_7.addWidget(self.iqrBox)
        self.gridLayout_4.addLayout(self.horizontalLayout_7, 1, 0, 1, 1)
        self.horizontalLayout_19 = QtGui.QHBoxLayout()
        self.horizontalLayout_19.setObjectName(
            _fromUtf8("horizontalLayout_19"))
        self.label_20 = QtGui.QLabel(self.outlierGroup)
        self.label_20.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.label_20.setObjectName(_fromUtf8("label_20"))
        self.horizontalLayout_19.addWidget(self.label_20)
        spacerItem5 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding,
                                        QtGui.QSizePolicy.Minimum)
        self.horizontalLayout_19.addItem(spacerItem5)
        self.outlierNameEdit = QtGui.QLineEdit(self.outlierGroup)
        self.outlierNameEdit.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.outlierNameEdit.setObjectName(_fromUtf8("outlierNameEdit"))
        self.horizontalLayout_19.addWidget(self.outlierNameEdit)
        self.gridLayout_4.addLayout(self.horizontalLayout_19, 4, 0, 1, 1)
        self.verticalLayout_5.addWidget(self.outlierGroup)
        self.analysisGroup = QtGui.QGroupBox(Dialog)
        self.analysisGroup.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.analysisGroup.setCheckable(True)
        self.analysisGroup.setObjectName(_fromUtf8("analysisGroup"))
        self.verticalLayout_9 = QtGui.QVBoxLayout(self.analysisGroup)
        self.verticalLayout_9.setObjectName(_fromUtf8("verticalLayout_9"))
        self.horizontalLayout_24 = QtGui.QHBoxLayout()
        self.horizontalLayout_24.setObjectName(
            _fromUtf8("horizontalLayout_24"))
        self.label_8 = QtGui.QLabel(self.analysisGroup)
        self.label_8.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.label_8.setObjectName(_fromUtf8("label_8"))
        self.horizontalLayout_24.addWidget(self.label_8)
        spacerItem6 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding,
                                        QtGui.QSizePolicy.Minimum)
        self.horizontalLayout_24.addItem(spacerItem6)
        self.polyBox = QtGui.QSpinBox(self.analysisGroup)
        self.polyBox.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.polyBox.setProperty("value", 1)
        self.polyBox.setObjectName(_fromUtf8("polyBox"))
        self.horizontalLayout_24.addWidget(self.polyBox)
        self.verticalLayout_9.addLayout(self.horizontalLayout_24)
        self.horizontalLayout_25 = QtGui.QHBoxLayout()
        self.horizontalLayout_25.setObjectName(
            _fromUtf8("horizontalLayout_25"))
        self.label_9 = QtGui.QLabel(self.analysisGroup)
        self.label_9.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.label_9.setObjectName(_fromUtf8("label_9"))
        self.horizontalLayout_25.addWidget(self.label_9)
        spacerItem7 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding,
                                        QtGui.QSizePolicy.Minimum)
        self.horizontalLayout_25.addItem(spacerItem7)
        self.periodEdit = QtGui.QLineEdit(self.analysisGroup)
        self.periodEdit.setEnabled(True)
        self.periodEdit.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.periodEdit.setObjectName(_fromUtf8("periodEdit"))
        self.horizontalLayout_25.addWidget(self.periodEdit)
        self.verticalLayout_9.addLayout(self.horizontalLayout_25)
        self.verticalLayout_3 = QtGui.QVBoxLayout()
        self.verticalLayout_3.setObjectName(_fromUtf8("verticalLayout_3"))
        self.label_10 = QtGui.QLabel(self.analysisGroup)
        self.label_10.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.label_10.setObjectName(_fromUtf8("label_10"))
        self.verticalLayout_3.addWidget(self.label_10)
        self.horizontalLayout_5 = QtGui.QHBoxLayout()
        self.horizontalLayout_5.setObjectName(_fromUtf8("horizontalLayout_5"))
        self.logDirEdit = QtGui.QLineEdit(self.analysisGroup)
        self.logDirEdit.setEnabled(True)
        self.logDirEdit.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.logDirEdit.setReadOnly(True)
        self.logDirEdit.setObjectName(_fromUtf8("logDirEdit"))
        self.horizontalLayout_5.addWidget(self.logDirEdit)
        self.logDirButton = QtGui.QToolButton(self.analysisGroup)
        self.logDirButton.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.logDirButton.setText(_fromUtf8(""))
        self.logDirButton.setObjectName(_fromUtf8("logDirButton"))
        self.horizontalLayout_5.addWidget(self.logDirButton)
        self.verticalLayout_3.addLayout(self.horizontalLayout_5)
        self.verticalLayout_9.addLayout(self.verticalLayout_3)
        self.verticalLayout_4 = QtGui.QVBoxLayout()
        self.verticalLayout_4.setObjectName(_fromUtf8("verticalLayout_4"))
        self.label_11 = QtGui.QLabel(self.analysisGroup)
        self.label_11.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.label_11.setObjectName(_fromUtf8("label_11"))
        self.verticalLayout_4.addWidget(self.label_11)
        self.horizontalLayout_9 = QtGui.QHBoxLayout()
        self.horizontalLayout_9.setObjectName(_fromUtf8("horizontalLayout_9"))
        self.saveDirEdit = QtGui.QLineEdit(self.analysisGroup)
        self.saveDirEdit.setEnabled(True)
        self.saveDirEdit.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.saveDirEdit.setReadOnly(True)
        self.saveDirEdit.setObjectName(_fromUtf8("saveDirEdit"))
        self.horizontalLayout_9.addWidget(self.saveDirEdit)
        self.saveDirButton = QtGui.QToolButton(self.analysisGroup)
        self.saveDirButton.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.saveDirButton.setText(_fromUtf8(""))
        self.saveDirButton.setObjectName(_fromUtf8("saveDirButton"))
        self.horizontalLayout_9.addWidget(self.saveDirButton)
        self.verticalLayout_4.addLayout(self.horizontalLayout_9)
        self.verticalLayout_9.addLayout(self.verticalLayout_4)
        self.horizontalLayout_10 = QtGui.QHBoxLayout()
        self.horizontalLayout_10.setObjectName(
            _fromUtf8("horizontalLayout_10"))
        self.label_14 = QtGui.QLabel(self.analysisGroup)
        self.label_14.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.label_14.setObjectName(_fromUtf8("label_14"))
        self.horizontalLayout_10.addWidget(self.label_14)
        spacerItem8 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding,
                                        QtGui.QSizePolicy.Minimum)
        self.horizontalLayout_10.addItem(spacerItem8)
        self.saveNameEdit = QtGui.QLineEdit(self.analysisGroup)
        self.saveNameEdit.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.saveNameEdit.setObjectName(_fromUtf8("saveNameEdit"))
        self.horizontalLayout_10.addWidget(self.saveNameEdit)
        self.verticalLayout_9.addLayout(self.horizontalLayout_10)
        self.verticalLayout_5.addWidget(self.analysisGroup)
        self.horizontalLayout_11.addLayout(self.verticalLayout_5)
        self.verticalLayout = QtGui.QVBoxLayout()
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.timeGroup = QtGui.QGroupBox(Dialog)
        self.timeGroup.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.timeGroup.setCheckable(True)
        self.timeGroup.setObjectName(_fromUtf8("timeGroup"))
        self.gridLayout = QtGui.QGridLayout(self.timeGroup)
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        self.timeEdit = QtGui.QPlainTextEdit(self.timeGroup)
        self.timeEdit.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.timeEdit.setLineWrapMode(QtGui.QPlainTextEdit.NoWrap)
        self.timeEdit.setObjectName(_fromUtf8("timeEdit"))
        self.gridLayout.addWidget(self.timeEdit, 0, 0, 1, 1)
        self.verticalLayout.addWidget(self.timeGroup)
        self.stackingGroup = QtGui.QGroupBox(Dialog)
        self.stackingGroup.setEnabled(False)
        self.stackingGroup.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.stackingGroup.setCheckable(True)
        self.stackingGroup.setObjectName(_fromUtf8("stackingGroup"))
        self.gridLayout_3 = QtGui.QGridLayout(self.stackingGroup)
        self.gridLayout_3.setObjectName(_fromUtf8("gridLayout_3"))
        self.horizontalLayout_3 = QtGui.QHBoxLayout()
        self.horizontalLayout_3.setObjectName(_fromUtf8("horizontalLayout_3"))
        self.label_4 = QtGui.QLabel(self.stackingGroup)
        self.label_4.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.label_4.setObjectName(_fromUtf8("label_4"))
        self.horizontalLayout_3.addWidget(self.label_4)
        spacerItem9 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding,
                                        QtGui.QSizePolicy.Minimum)
        self.horizontalLayout_3.addItem(spacerItem9)
        self.cmeBox = QtGui.QComboBox(self.stackingGroup)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred,
                                       QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.cmeBox.sizePolicy().hasHeightForWidth())
        self.cmeBox.setSizePolicy(sizePolicy)
        self.cmeBox.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.cmeBox.setObjectName(_fromUtf8("cmeBox"))
        self.cmeBox.addItem(_fromUtf8(""))
        self.cmeBox.addItem(_fromUtf8(""))
        self.horizontalLayout_3.addWidget(self.cmeBox)
        self.gridLayout_3.addLayout(self.horizontalLayout_3, 0, 0, 1, 1)
        self.verticalLayout_6 = QtGui.QVBoxLayout()
        self.verticalLayout_6.setObjectName(_fromUtf8("verticalLayout_6"))
        self.label_3 = QtGui.QLabel(self.stackingGroup)
        self.label_3.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.label_3.setObjectName(_fromUtf8("label_3"))
        self.verticalLayout_6.addWidget(self.label_3)
        self.horizontalLayout_2 = QtGui.QHBoxLayout()
        self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2"))
        self.cmeEdit = QtGui.QLineEdit(self.stackingGroup)
        self.cmeEdit.setEnabled(False)
        self.cmeEdit.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.cmeEdit.setReadOnly(True)
        self.cmeEdit.setObjectName(_fromUtf8("cmeEdit"))
        self.horizontalLayout_2.addWidget(self.cmeEdit)
        self.cmeButton = QtGui.QToolButton(self.stackingGroup)
        self.cmeButton.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.cmeButton.setText(_fromUtf8(""))
        self.cmeButton.setObjectName(_fromUtf8("cmeButton"))
        self.horizontalLayout_2.addWidget(self.cmeButton)
        self.verticalLayout_6.addLayout(self.horizontalLayout_2)
        self.gridLayout_3.addLayout(self.verticalLayout_6, 1, 0, 1, 1)
        self.verticalLayout.addWidget(self.stackingGroup)
        self.horizontalLayout_11.addLayout(self.verticalLayout)
        self.verticalLayout_8.addLayout(self.horizontalLayout_11)
        self.horizontalLayout_23 = QtGui.QHBoxLayout()
        self.horizontalLayout_23.setObjectName(
            _fromUtf8("horizontalLayout_23"))
        self.label_24 = QtGui.QLabel(Dialog)
        self.label_24.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.label_24.setObjectName(_fromUtf8("label_24"))
        self.horizontalLayout_23.addWidget(self.label_24)
        self.progressBar = QtGui.QProgressBar(Dialog)
        self.progressBar.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.progressBar.setProperty("value", 0)
        self.progressBar.setObjectName(_fromUtf8("progressBar"))
        self.horizontalLayout_23.addWidget(self.progressBar)
        self.batchButton = QtGui.QPushButton(Dialog)
        self.batchButton.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.batchButton.setObjectName(_fromUtf8("batchButton"))
        self.horizontalLayout_23.addWidget(self.batchButton)
        self.verticalLayout_8.addLayout(self.horizontalLayout_23)
        self.gridLayout_2.addLayout(self.verticalLayout_8, 0, 1, 1, 1)

        self.retranslateUi(Dialog)
        QtCore.QMetaObject.connectSlotsByName(Dialog)
예제 #50
0
def main():
    app = QtGui.QApplication(sys.argv)
    ex = Example()
    sys.exit(app.exec_())
예제 #51
0
 def paintEvent(self, e):
     qp = QtGui.QPainter()
     qp.begin(self)
     self.drawWidget(qp)
     qp.end()
예제 #52
0
    def setupUi(self, coreDumpUtilFrame):
        coreDumpUtilFrame.setObjectName(_fromUtf8("coreDumpUtilFrame"))
        coreDumpUtilFrame.setWindowModality(QtCore.Qt.ApplicationModal)
        coreDumpUtilFrame.resize(655, 380)
        coreDumpUtilFrame.setMaximumSize(QtCore.QSize(655, 430))
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("FreeSans"))
        coreDumpUtilFrame.setFont(font)
        self.centralWidget = QtGui.QWidget(coreDumpUtilFrame)
        self.centralWidget.setObjectName(_fromUtf8("centralWidget"))
        self.lbanner = QtGui.QLabel(self.centralWidget)
        self.lbanner.setGeometry(QtCore.QRect(20, 0, 381, 91))
        font = QtGui.QFont()
        font.setPointSize(12)
        font.setBold(True)
        font.setUnderline(True)
        font.setWeight(75)
        self.lbanner.setFont(font)
        self.lbanner.setWordWrap(True)
        self.lbanner.setObjectName(_fromUtf8("lbanner"))
        self.lbannerImage = QtGui.QLabel(self.centralWidget)
        self.lbannerImage.setGeometry(QtCore.QRect(370, -10, 331, 81))
        self.lbannerImage.setText(_fromUtf8(""))
        self.lbannerImage.setPixmap(QtGui.QPixmap(_fromUtf8("LogoSJ.png")))
        self.lbannerImage.setObjectName(_fromUtf8("lbannerImage"))
        self.lArchitecture = QtGui.QLabel(self.centralWidget)
        self.lArchitecture.setGeometry(QtCore.QRect(10, 100, 91, 16))
        self.lArchitecture.setObjectName(_fromUtf8("lArchitecture"))
        self.comboArchType = QtGui.QComboBox(self.centralWidget)
        self.comboArchType.setGeometry(QtCore.QRect(290, 90, 77, 21))
        self.comboArchType.setFocusPolicy(QtCore.Qt.TabFocus)
        self.comboArchType.setObjectName(_fromUtf8("comboArchType"))
        self.comboArchType.addItem(_fromUtf8(""))
        self.comboArchType.addItem(_fromUtf8(""))
        self.lSysRoot = QtGui.QLabel(self.centralWidget)
        self.lSysRoot.setGeometry(QtCore.QRect(20, 140, 54, 15))
        self.lSysRoot.setObjectName(_fromUtf8("lSysRoot"))
        self.bSysRootBrowse = QtGui.QPushButton(self.centralWidget)
        self.bSysRootBrowse.setGeometry(QtCore.QRect(290, 130, 85, 27))
        self.bSysRootBrowse.setFocusPolicy(QtCore.Qt.TabFocus)
        self.bSysRootBrowse.setObjectName(_fromUtf8("bSysRootBrowse"))
        self.lSysRootFilePath = QtGui.QLabel(self.centralWidget)
        self.lSysRootFilePath.setGeometry(QtCore.QRect(430, 130, 251, 16))
        self.lSysRootFilePath.setObjectName(_fromUtf8("lSysRootFilePath"))
        self.lApplicationExe = QtGui.QLabel(self.centralWidget)
        self.lApplicationExe.setGeometry(QtCore.QRect(20, 180, 101, 16))
        self.lApplicationExe.setObjectName(_fromUtf8("lApplicationExe"))
        self.bApplicationBrowser = QtGui.QPushButton(self.centralWidget)
        self.bApplicationBrowser.setGeometry(QtCore.QRect(290, 170, 85, 27))
        self.bApplicationBrowser.setFocusPolicy(QtCore.Qt.TabFocus)
        self.bApplicationBrowser.setObjectName(_fromUtf8("bApplicationBrowser"))
        self.lApplicationFilePath = QtGui.QLabel(self.centralWidget)
        self.lApplicationFilePath.setGeometry(QtCore.QRect(430, 170, 101, 20))
        self.lApplicationFilePath.setObjectName(_fromUtf8("lApplicationFilePath"))
        self.lCoreFile = QtGui.QLabel(self.centralWidget)
        self.lCoreFile.setGeometry(QtCore.QRect(20, 220, 121, 16))
        self.lCoreFile.setObjectName(_fromUtf8("lCoreFile"))
        self.lCoreFileBrowser = QtGui.QPushButton(self.centralWidget)
        self.lCoreFileBrowser.setGeometry(QtCore.QRect(290, 210, 85, 27))
        self.lCoreFileBrowser.setFocusPolicy(QtCore.Qt.TabFocus)
        self.lCoreFileBrowser.setStatusTip(_fromUtf8(""))
        self.lCoreFileBrowser.setObjectName(_fromUtf8("lCoreFileBrowser"))
        self.lCorefileBrowser = QtGui.QLabel(self.centralWidget)
        self.lCorefileBrowser.setGeometry(QtCore.QRect(430, 210, 101, 16))
        self.lCorefileBrowser.setObjectName(_fromUtf8("lCorefileBrowser"))
        self.bgetBackTrace = QtGui.QPushButton(self.centralWidget)
        self.bgetBackTrace.setGeometry(QtCore.QRect(160, 280, 231, 27))
        self.bgetBackTrace.setObjectName(_fromUtf8("bgetBackTrace"))
        coreDumpUtilFrame.setCentralWidget(self.centralWidget)
        self.menuBar = QtGui.QMenuBar(coreDumpUtilFrame)
        self.menuBar.setGeometry(QtCore.QRect(0, 0, 655, 22))
        self.menuBar.setObjectName(_fromUtf8("menuBar"))
        coreDumpUtilFrame.setMenuBar(self.menuBar)
        self.mainToolBar = QtGui.QToolBar(coreDumpUtilFrame)
        self.mainToolBar.setObjectName(_fromUtf8("mainToolBar"))
        coreDumpUtilFrame.addToolBar(QtCore.Qt.TopToolBarArea, self.mainToolBar)
        self.statusBar = QtGui.QStatusBar(coreDumpUtilFrame)
        self.statusBar.setObjectName(_fromUtf8("statusBar"))
        coreDumpUtilFrame.setStatusBar(self.statusBar)

        self.retranslateUi(coreDumpUtilFrame)
        QtCore.QMetaObject.connectSlotsByName(coreDumpUtilFrame)
        coreDumpUtilFrame.setTabOrder(self.comboArchType, self.bSysRootBrowse)
        coreDumpUtilFrame.setTabOrder(self.bSysRootBrowse, self.bApplicationBrowser)
        coreDumpUtilFrame.setTabOrder(self.bApplicationBrowser, self.lCoreFileBrowser)
        coreDumpUtilFrame.setTabOrder(self.lCoreFileBrowser, self.bgetBackTrace)
예제 #53
0
파일: Detector.py 프로젝트: yue123161/botd
def main():
    wc = WindowContainer()
    app = QtGui.QApplication(sys.argv)
    launcher = Launcher(wc)
    # main_app = MainApplication("/media/SURF2017/SURF2017/datasets/CTU-13-Dataset/9/capture20110817pcaptruncated_300_150")
    sys.exit(app.exec_())
예제 #54
0
class Dialog(QtGui.QDialog):
    """
    Base used for all dialog windows.
    """

    _FONT_HEADER = QtGui.QFont()
    _FONT_HEADER.setPointSize(12)
    _FONT_HEADER.setBold(True)

    _FONT_INFO = QtGui.QFont()
    _FONT_INFO.setItalic(True)

    _FONT_LABEL = QtGui.QFont()
    _FONT_LABEL.setBold(True)

    _FONT_TITLE = QtGui.QFont()
    _FONT_TITLE.setPointSize(16)
    _FONT_TITLE.setBold(True)

    _SPACING = 10

    __slots__ = [
        '_addon',  # bundle of config, logger, paths, router, version
        '_title',  # description of this window
    ]

    def __init__(self, title, addon, parent):
        """
        Set the modal status for the dialog, sets its layout to the
        return value of the _ui() method, and sets a default title.
        """

        self._addon = addon
        self._addon.logger.debug(
            "Constructing %s (%s) dialog",
            title, self.__class__.__name__,
        )
        self._title = title

        super(Dialog, self).__init__(parent)

        self.setModal(True)
        self.setLayout(self._ui())
        self.setWindowFlags(
            self.windowFlags() &
            ~QtCore.Qt.WindowContextHelpButtonHint
        )
        self.setWindowIcon(ICON)
        self.setWindowTitle(
            title if "AwesomeTTS" in title
            else "AwesomeTTS: " + title
        )

    # UI Construction ########################################################

    def _ui(self):
        """
        Returns a vertical layout with a banner.

        Subclasses should call this method first when overriding so that
        all dialogs have the same banner.
        """

        layout = QtGui.QVBoxLayout()
        layout.addLayout(self._ui_banner())
        layout.addWidget(self._ui_divider(QtGui.QFrame.HLine))

        return layout

    def _ui_banner(self):
        """
        Returns a horizontal layout with some title text, a strecher,
        and version text.

        For subclasses, this method will be called automatically as part
        of the base class _ui() method.
        """

        title = Label(self._title)
        title.setFont(self._FONT_TITLE)

        version = Label("AwesomeTTS\nv" + self._addon.version)
        version.setFont(self._FONT_INFO)

        layout = QtGui.QHBoxLayout()
        layout.addWidget(title)
        layout.addSpacing(self._SPACING)
        layout.addStretch()
        layout.addWidget(version)

        return layout

    def _ui_divider(self, orientation_style=QtGui.QFrame.VLine):
        """
        Returns a divider.

        For subclasses, this method will be called automatically as part
        of the base class _ui() method.
        """

        frame = QtGui.QFrame()
        frame.setFrameStyle(orientation_style | QtGui.QFrame.Sunken)

        return frame

    def _ui_buttons(self):
        """
        Returns a horizontal row of standard dialog buttons, with "OK"
        and "Cancel". If the subclass implements help_request() or
        help_menu(), a "Help" button will also be shown.

        Subclasses must call this method explicitly, at a location of
        their choice. Once called, accept(), reject(), and optionally
        help_request() become wired to the appropriate signals.
        """

        buttons = QtGui.QDialogButtonBox()
        buttons.accepted.connect(self.accept)
        buttons.rejected.connect(self.reject)

        has_help_menu = callable(getattr(self, 'help_menu', None))
        has_help_request = callable(getattr(self, 'help_request', None))

        if has_help_menu or has_help_request:
            if has_help_request:
                buttons.helpRequested.connect(self.help_request)

            buttons.setStandardButtons(
                QtGui.QDialogButtonBox.Help |
                QtGui.QDialogButtonBox.Cancel |
                QtGui.QDialogButtonBox.Ok
            )

        else:
            buttons.setStandardButtons(
                QtGui.QDialogButtonBox.Cancel |
                QtGui.QDialogButtonBox.Ok
            )

        for btn in buttons.buttons():
            if buttons.buttonRole(btn) == QtGui.QDialogButtonBox.AcceptRole:
                btn.setObjectName('okay')
            elif buttons.buttonRole(btn) == QtGui.QDialogButtonBox.RejectRole:
                btn.setObjectName('cancel')
            elif (buttons.buttonRole(btn) == QtGui.QDialogButtonBox.HelpRole
                  and has_help_menu):
                btn.setMenu(self.help_menu(btn))

        return buttons

    # Events #################################################################

    def show(self, *args, **kwargs):
        """
        Writes a log message and pass onto superclass.
        """

        self._addon.logger.debug("Showing '%s' dialog", self.windowTitle())
        super(Dialog, self).show(*args, **kwargs)

    # Auxiliary ##############################################################

    def _launch_link(self, path):
        """
        Opens a URL on the AwesomeTTS website with the given path.
        """

        url = '/'.join([self._addon.web, path])
        self._addon.logger.debug("Launching %s", url)
        QtGui.QDesktopServices.openUrl(QtCore.QUrl(url))
예제 #55
0
import sys
from PyQt4 import QtGui, QtCore


class Demowind(QtGui.QWidget):
    def __init__(self, parent=None):
        QtGui.QWidget.__init__(self, parent)
        self.setGeometry(300, 300, 200, 200)
        self.setWindowTitle("Demo Window")
        quit = QtGui.QPushButton("Close", self)
        quit.setGeometry(10, 10, 70, 40)
        self.connect(quit, QtCore.SIGNAL("clicked()"), QtGui.qApp, QtCore.SLOT("quit()"))

app = QtGui.QApplication(sys.argv)
dw = Demowind()
dw.show()
sys.exit(app.exec_())
예제 #56
0
def main():
    app = QtGui.QApplication(sys.argv)  # A new instance of QApplication
    mainWin = pycketGUI()
    mainWin.show()
    app.exec_()
예제 #57
0
    def setupUi(self, MainWindow):
        MainWindow.setObjectName(_fromUtf8("MainWindow"))
        MainWindow.resize(1230, 900)
        self.centralwidget = QtGui.QWidget(MainWindow)
        self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
        self.kinectFrame = QtGui.QFrame(self.centralwidget)
        self.kinectFrame.setGeometry(QtCore.QRect(240, 40, 640, 480))
        self.kinectFrame.setFrameShape(QtGui.QFrame.StyledPanel)
        self.kinectFrame.setFrameShadow(QtGui.QFrame.Raised)
        self.kinectFrame.setObjectName(_fromUtf8("kinectFrame"))
        self.videoDisplay = QtGui.QLabel(self.kinectFrame)
        self.videoDisplay.setGeometry(QtCore.QRect(0, 0, 640, 480))
        self.videoDisplay.setObjectName(_fromUtf8("videoDisplay"))
        self.OutputFrame = QtGui.QFrame(self.centralwidget)
        self.OutputFrame.setGeometry(QtCore.QRect(10, 40, 221, 311))
        self.OutputFrame.setFrameShape(QtGui.QFrame.StyledPanel)
        self.OutputFrame.setFrameShadow(QtGui.QFrame.Raised)
        self.OutputFrame.setObjectName(_fromUtf8("OutputFrame"))
        self.JointCoordLabel = QtGui.QLabel(self.OutputFrame)
        self.JointCoordLabel.setGeometry(QtCore.QRect(40, 10, 141, 17))
        font = QtGui.QFont()
        font.setBold(True)
        font.setWeight(75)
        self.JointCoordLabel.setFont(font)
        self.JointCoordLabel.setObjectName(_fromUtf8("JointCoordLabel"))
        self.WorldCoordLabel = QtGui.QLabel(self.OutputFrame)
        self.WorldCoordLabel.setGeometry(QtCore.QRect(30, 160, 161, 17)) #(30, 160, 161, 17)
        font = QtGui.QFont()
        font.setBold(True)
        font.setWeight(75)
        self.WorldCoordLabel.setFont(font)
        self.WorldCoordLabel.setObjectName(_fromUtf8("WorldCoordLabel"))
        self.layoutWidget_2 = QtGui.QWidget(self.OutputFrame)
        self.layoutWidget_2.setGeometry(QtCore.QRect(80, 30, 131, 130)) #(80, 30, 131, 120)
        self.layoutWidget_2.setObjectName(_fromUtf8("layoutWidget_2"))
        self.verticalLayout_8 = QtGui.QVBoxLayout(self.layoutWidget_2)
        self.verticalLayout_8.setObjectName(_fromUtf8("verticalLayout_8"))
        self.rdoutBaseJC = QtGui.QLabel(self.layoutWidget_2)
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Ubuntu Mono"))
        font.setPointSize(14)
        self.rdoutBaseJC.setFont(font)
        self.rdoutBaseJC.setObjectName(_fromUtf8("rdoutBaseJC"))
        self.verticalLayout_8.addWidget(self.rdoutBaseJC, QtCore.Qt.AlignLeft)
        self.rdoutShoulderJC = QtGui.QLabel(self.layoutWidget_2)
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Ubuntu Mono"))
        font.setPointSize(14)
        self.rdoutShoulderJC.setFont(font)
        self.rdoutShoulderJC.setObjectName(_fromUtf8("rdoutShoulderJC"))
        self.verticalLayout_8.addWidget(self.rdoutShoulderJC, QtCore.Qt.AlignLeft)
        self.rdoutElbowJC = QtGui.QLabel(self.layoutWidget_2)
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Ubuntu Mono"))
        font.setPointSize(14)
        self.rdoutElbowJC.setFont(font)
        self.rdoutElbowJC.setObjectName(_fromUtf8("rdoutElbowJC"))
        self.verticalLayout_8.addWidget(self.rdoutElbowJC, QtCore.Qt.AlignLeft)
        self.rdoutWristJC = QtGui.QLabel(self.layoutWidget_2)
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Ubuntu Mono"))
        font.setPointSize(14)
        self.rdoutWristJC.setFont(font)
        self.rdoutWristJC.setObjectName(_fromUtf8("rdoutWristJC"))
        self.verticalLayout_8.addWidget(self.rdoutWristJC, QtCore.Qt.AlignLeft)
        self.rdoutWrist2JC = QtGui.QLabel(self.layoutWidget_2)
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Ubuntu Mono"))
        font.setPointSize(14)
        self.rdoutWrist2JC.setFont(font)
        self.rdoutWrist2JC.setObjectName(_fromUtf8("rdoutWrist2JC"))
        self.verticalLayout_8.addWidget(self.rdoutWrist2JC, QtCore.Qt.AlignLeft)
        self.rdoutWrist3JC = QtGui.QLabel(self.layoutWidget_2)
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Ubuntu Mono"))
        font.setPointSize(14)
        self.rdoutWrist3JC.setFont(font)
        self.rdoutWrist3JC.setObjectName(_fromUtf8("rdoutWrist3JC"))
        self.verticalLayout_8.addWidget(self.rdoutWrist3JC, QtCore.Qt.AlignLeft)
        self.layoutWidget_3 = QtGui.QWidget(self.OutputFrame)
        self.layoutWidget_3.setGeometry(QtCore.QRect(10, 30, 66, 130)) #(10, 30, 66, 120)
        self.layoutWidget_3.setObjectName(_fromUtf8("layoutWidget_3"))
        self.verticalLayout_9 = QtGui.QVBoxLayout(self.layoutWidget_3)
        self.verticalLayout_9.setObjectName(_fromUtf8("verticalLayout_9"))
        self.BLabel = QtGui.QLabel(self.layoutWidget_3)
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Ubuntu Mono"))
        font.setPointSize(14)
        self.BLabel.setFont(font)
        self.BLabel.setObjectName(_fromUtf8("BLabel"))
        self.verticalLayout_9.addWidget(self.BLabel, QtCore.Qt.AlignRight)
        self.SLabel = QtGui.QLabel(self.layoutWidget_3)
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Ubuntu Mono"))
        font.setPointSize(14)
        self.SLabel.setFont(font)
        self.SLabel.setObjectName(_fromUtf8("SLabel"))
        self.verticalLayout_9.addWidget(self.SLabel, QtCore.Qt.AlignRight)
        self.ELabel = QtGui.QLabel(self.layoutWidget_3)
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Ubuntu Mono"))
        font.setPointSize(14)
        self.ELabel.setFont(font)
        self.ELabel.setObjectName(_fromUtf8("ELabel"))
        self.verticalLayout_9.addWidget(self.ELabel, QtCore.Qt.AlignRight)
        self.WLabel = QtGui.QLabel(self.layoutWidget_3)
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Ubuntu Mono"))
        font.setPointSize(14)
        self.WLabel.setFont(font)
        self.WLabel.setObjectName(_fromUtf8("WLabel"))
        self.verticalLayout_9.addWidget(self.WLabel, QtCore.Qt.AlignRight)
        self.W2Label = QtGui.QLabel(self.layoutWidget_3)
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Ubuntu Mono"))
        font.setPointSize(14)
        self.W2Label.setFont(font)
        self.W2Label.setObjectName(_fromUtf8("W2Label"))
        self.verticalLayout_9.addWidget(self.W2Label, QtCore.Qt.AlignRight)
        self.W3Label = QtGui.QLabel(self.layoutWidget_3)
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Ubuntu Mono"))
        font.setPointSize(14)
        self.W3Label.setFont(font)
        self.W3Label.setObjectName(_fromUtf8("W3Label"))
        self.verticalLayout_9.addWidget(self.W3Label, QtCore.Qt.AlignRight)
        self.layoutWidget_4 = QtGui.QWidget(self.OutputFrame)
        self.layoutWidget_4.setGeometry(QtCore.QRect(80, 179, 131, 121))
        self.layoutWidget_4.setObjectName(_fromUtf8("layoutWidget_4"))
        self.verticalLayout_12 = QtGui.QVBoxLayout(self.layoutWidget_4)
        self.verticalLayout_12.setObjectName(_fromUtf8("verticalLayout_12"))
        self.rdoutX = QtGui.QLabel(self.layoutWidget_4)
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Ubuntu Mono"))
        font.setPointSize(14)
        self.rdoutX.setFont(font)
        self.rdoutX.setObjectName(_fromUtf8("rdoutX"))
        self.verticalLayout_12.addWidget(self.rdoutX, QtCore.Qt.AlignLeft)
        self.rdoutY = QtGui.QLabel(self.layoutWidget_4)
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Ubuntu Mono"))
        font.setPointSize(14)
        self.rdoutY.setFont(font)
        self.rdoutY.setObjectName(_fromUtf8("rdoutY"))
        self.verticalLayout_12.addWidget(self.rdoutY, QtCore.Qt.AlignLeft)
        self.rdoutZ = QtGui.QLabel(self.layoutWidget_4)
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Ubuntu Mono"))
        font.setPointSize(14)
        self.rdoutZ.setFont(font)
        self.rdoutZ.setObjectName(_fromUtf8("rdoutZ"))
        self.verticalLayout_12.addWidget(self.rdoutZ, QtCore.Qt.AlignLeft)
        self.rdoutT = QtGui.QLabel(self.layoutWidget_4)
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Ubuntu Mono"))
        font.setPointSize(14)
        self.rdoutT.setFont(font)
        self.rdoutT.setObjectName(_fromUtf8("rdoutT"))
        self.verticalLayout_12.addWidget(self.rdoutT, QtCore.Qt.AlignLeft)
        # self.rdoutG = QtGui.QLabel(self.layoutWidget_4)
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Ubuntu Mono"))
        font.setPointSize(14)
        # self.rdoutG.setFont(font)
        # self.rdoutG.setObjectName(_fromUtf8("rdoutG"))
        # self.verticalLayout_12.addWidget(self.rdoutG, QtCore.Qt.AlignLeft)
        # self.rdoutP = QtGui.QLabel(self.layoutWidget_4)
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Ubuntu Mono"))
        font.setPointSize(14)
        # self.rdoutP.setFont(font)
        # self.rdoutP.setObjectName(_fromUtf8("rdoutP"))
        # self.verticalLayout_12.addWidget(self.rdoutP, QtCore.Qt.AlignLeft)
        self.layoutWidget_5 = QtGui.QWidget(self.OutputFrame)
        self.layoutWidget_5.setGeometry(QtCore.QRect(11, 180, 66, 121))
        self.layoutWidget_5.setObjectName(_fromUtf8("layoutWidget_5"))
        self.verticalLayout_13 = QtGui.QVBoxLayout(self.layoutWidget_5)
        self.verticalLayout_13.setObjectName(_fromUtf8("verticalLayout_13"))
        self.XLabel = QtGui.QLabel(self.layoutWidget_5)
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Ubuntu Mono"))
        font.setPointSize(14)
        self.XLabel.setFont(font)
        self.XLabel.setObjectName(_fromUtf8("XLabel"))
        self.verticalLayout_13.addWidget(self.XLabel, QtCore.Qt.AlignRight)
        self.YLabel = QtGui.QLabel(self.layoutWidget_5)
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Ubuntu Mono"))
        font.setPointSize(14)
        self.YLabel.setFont(font)
        self.YLabel.setObjectName(_fromUtf8("YLabel"))
        self.verticalLayout_13.addWidget(self.YLabel, QtCore.Qt.AlignRight)
        self.ZLabel = QtGui.QLabel(self.layoutWidget_5)
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Ubuntu Mono"))
        font.setPointSize(14)
        self.ZLabel.setFont(font)
        self.ZLabel.setObjectName(_fromUtf8("ZLabel"))
        self.verticalLayout_13.addWidget(self.ZLabel, QtCore.Qt.AlignRight)
        self.TLabel = QtGui.QLabel(self.layoutWidget_5)
        self.TLabel.setEnabled(True)
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Ubuntu Mono"))
        font.setPointSize(14)
        self.TLabel.setFont(font)
        self.TLabel.setObjectName(_fromUtf8("TLabel"))
        self.verticalLayout_13.addWidget(self.TLabel, QtCore.Qt.AlignRight)
        # self.GLabel = QtGui.QLabel(self.layoutWidget_5)
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Ubuntu Mono"))
        font.setPointSize(14)
        # self.GLabel.setFont(font)
        # self.GLabel.setObjectName(_fromUtf8("GLabel"))
        # self.verticalLayout_13.addWidget(self.GLabel, QtCore.Qt.AlignRight)
        # self.PLabel = QtGui.QLabel(self.layoutWidget_5)
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Ubuntu Mono"))
        font.setPointSize(14)
        # self.PLabel.setFont(font)
        # self.PLabel.setObjectName(_fromUtf8("PLabel"))
        # self.verticalLayout_13.addWidget(self.PLabel, QtCore.Qt.AlignRight)
        self.btn_estop = QtGui.QPushButton(self.centralwidget)
        self.btn_estop.setGeometry(QtCore.QRect(900, 40, 311, 71))
        font = QtGui.QFont()
        font.setPointSize(20)
        font.setBold(True)
        font.setWeight(75)
        self.btn_estop.setFont(font)
        self.btn_estop.setObjectName(_fromUtf8("btn_estop"))
        self.btn_exec = QtGui.QPushButton(self.centralwidget)
        self.btn_exec.setGeometry(QtCore.QRect(900, 120, 311, 71))
        font = QtGui.QFont()
        font.setPointSize(20)
        font.setBold(True)
        font.setWeight(75)
        self.btn_exec.setFont(font)
        self.btn_exec.setObjectName(_fromUtf8("btn_exec"))
        self.radioVideo = QtGui.QRadioButton(self.centralwidget)
        self.radioVideo.setGeometry(QtCore.QRect(240, 10, 117, 22))
        self.radioVideo.setChecked(True)
        self.radioVideo.setAutoExclusive(True)
        self.radioVideo.setObjectName(_fromUtf8("radioVideo"))
        self.radioUsr2 = QtGui.QRadioButton(self.centralwidget)
        self.radioUsr2.setGeometry(QtCore.QRect(610, 10, 117, 22))
        self.radioUsr2.setObjectName(_fromUtf8("radioUsr2"))
        self.radioApril = QtGui.QRadioButton(self.centralwidget)
        self.radioApril.setGeometry(QtCore.QRect(360, 10, 117, 22))
        self.radioApril.setObjectName(_fromUtf8("radioApril"))
        self.radioUsr1 = QtGui.QRadioButton(self.centralwidget)
        self.radioUsr1.setGeometry(QtCore.QRect(480, 10, 117, 22))
        self.radioUsr1.setObjectName(_fromUtf8("radioUsr1"))
        self.SliderFrame = QtGui.QGroupBox(self.centralwidget)
        self.SliderFrame.setGeometry(QtCore.QRect(240, 590, 641, 191))
        self.SliderFrame.setObjectName(_fromUtf8("SliderFrame"))
        self.layoutWidget = QtGui.QWidget(self.SliderFrame)
        self.layoutWidget.setGeometry(QtCore.QRect(0, 20, 65, 150)) #136
        self.layoutWidget.setObjectName(_fromUtf8("layoutWidget"))
        self.verticalLayout = QtGui.QVBoxLayout(self.layoutWidget)
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.BLabelS = QtGui.QLabel(self.layoutWidget)
        self.BLabelS.setObjectName(_fromUtf8("BLabelS"))
        self.verticalLayout.addWidget(self.BLabelS, QtCore.Qt.AlignRight)
        self.SLabelS = QtGui.QLabel(self.layoutWidget)
        self.SLabelS.setObjectName(_fromUtf8("SLabelS"))
        self.verticalLayout.addWidget(self.SLabelS, QtCore.Qt.AlignRight)
        self.ELabelS = QtGui.QLabel(self.layoutWidget)
        self.ELabelS.setObjectName(_fromUtf8("ELabelS"))
        self.verticalLayout.addWidget(self.ELabelS, QtCore.Qt.AlignRight)
        self.WLabelS = QtGui.QLabel(self.layoutWidget)
        self.WLabelS.setObjectName(_fromUtf8("WLabelS"))
        self.verticalLayout.addWidget(self.WLabelS, QtCore.Qt.AlignRight)
        self.W2LabelS = QtGui.QLabel(self.layoutWidget)
        self.W2LabelS.setObjectName(_fromUtf8("W2LabelS"))
        self.verticalLayout.addWidget(self.W2LabelS, QtCore.Qt.AlignRight)
        self.W3LabelS = QtGui.QLabel(self.layoutWidget)
        self.W3LabelS.setObjectName(_fromUtf8("W3LabelS"))
        self.verticalLayout.addWidget(self.W3LabelS, QtCore.Qt.AlignRight)
        self.layoutWidget_6 = QtGui.QWidget(self.SliderFrame)
        self.layoutWidget_6.setGeometry(QtCore.QRect(70, 20, 371, 150)) #70, 20, 371, 136
        self.layoutWidget_6.setObjectName(_fromUtf8("layoutWidget_6"))
        self.verticalLayout_2 = QtGui.QVBoxLayout(self.layoutWidget_6)
        self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2"))
        self.sldrBase = QtGui.QSlider(self.layoutWidget_6)
        self.sldrBase.setMinimum(-179)
        self.sldrBase.setMaximum(180)
        self.sldrBase.setOrientation(QtCore.Qt.Horizontal)
        self.sldrBase.setObjectName(_fromUtf8("sldrBase"))
        self.verticalLayout_2.addWidget(self.sldrBase)
        self.sldrShoulder = QtGui.QSlider(self.layoutWidget_6)
        self.sldrShoulder.setMinimum(-179)
        self.sldrShoulder.setMaximum(180)
        self.sldrShoulder.setOrientation(QtCore.Qt.Horizontal)
        self.sldrShoulder.setObjectName(_fromUtf8("sldrShoulder"))
        self.verticalLayout_2.addWidget(self.sldrShoulder)
        self.sldrElbow = QtGui.QSlider(self.layoutWidget_6)
        self.sldrElbow.setMinimum(-179)
        self.sldrElbow.setMaximum(180)
        self.sldrElbow.setOrientation(QtCore.Qt.Horizontal)
        self.sldrElbow.setObjectName(_fromUtf8("sldrElbow"))
        self.verticalLayout_2.addWidget(self.sldrElbow)
        self.sldrWrist = QtGui.QSlider(self.layoutWidget_6)
        self.sldrWrist.setMinimum(-179)
        self.sldrWrist.setMaximum(180)
        self.sldrWrist.setOrientation(QtCore.Qt.Horizontal)
        self.sldrWrist.setObjectName(_fromUtf8("sldrWrist"))
        self.verticalLayout_2.addWidget(self.sldrWrist)
        self.sldrWrist2 = QtGui.QSlider(self.layoutWidget_6)
        self.sldrWrist2.setMinimum(-179)
        self.sldrWrist2.setMaximum(180)
        self.sldrWrist2.setOrientation(QtCore.Qt.Horizontal)
        self.sldrWrist2.setObjectName(_fromUtf8("sldrWrist2"))
        self.verticalLayout_2.addWidget(self.sldrWrist2)
        self.sldrWrist3 = QtGui.QSlider(self.layoutWidget_6)
        self.sldrWrist3.setMinimum(-179)
        self.sldrWrist3.setMaximum(180)
        self.sldrWrist3.setOrientation(QtCore.Qt.Horizontal)
        self.sldrWrist3.setObjectName(_fromUtf8("sldrWrist3"))
        self.verticalLayout_2.addWidget(self.sldrWrist3)
        self.layoutWidget_7 = QtGui.QWidget(self.SliderFrame)
        self.layoutWidget_7.setGeometry(QtCore.QRect(462, 20, 51, 147)) #(462, 20, 51, 137)
        self.layoutWidget_7.setObjectName(_fromUtf8("layoutWidget_7"))
        self.verticalLayout_6 = QtGui.QVBoxLayout(self.layoutWidget_7)
        self.verticalLayout_6.setObjectName(_fromUtf8("verticalLayout_6"))
        self.rdoutBase = QtGui.QLabel(self.layoutWidget_7)
        self.rdoutBase.setObjectName(_fromUtf8("rdoutBase"))
        self.verticalLayout_6.addWidget(self.rdoutBase)
        self.rdoutShoulder = QtGui.QLabel(self.layoutWidget_7)
        self.rdoutShoulder.setObjectName(_fromUtf8("rdoutShoulder"))
        self.verticalLayout_6.addWidget(self.rdoutShoulder)
        self.rdoutElbow = QtGui.QLabel(self.layoutWidget_7)
        self.rdoutElbow.setObjectName(_fromUtf8("rdoutElbow"))
        self.verticalLayout_6.addWidget(self.rdoutElbow)
        self.rdoutWrist = QtGui.QLabel(self.layoutWidget_7)
        self.rdoutWrist.setObjectName(_fromUtf8("rdoutWrist"))
        self.verticalLayout_6.addWidget(self.rdoutWrist)
        self.rdoutWrist2 = QtGui.QLabel(self.layoutWidget_7)
        self.rdoutWrist2.setObjectName(_fromUtf8("rdoutWrist2"))
        self.verticalLayout_6.addWidget(self.rdoutWrist2)
        self.rdoutWrist3 = QtGui.QLabel(self.layoutWidget_7)
        self.rdoutWrist3.setObjectName(_fromUtf8("rdoutWrist3"))
        self.verticalLayout_6.addWidget(self.rdoutWrist3)
        self.sldrGrip1 = QtGui.QSlider(self.SliderFrame)
        self.sldrGrip1.setGeometry(QtCore.QRect(77, 166, 133, 29)) #77
        self.sldrGrip1.setMinimum(-179)
        self.sldrGrip1.setMaximum(180)
        self.sldrGrip1.setOrientation(QtCore.Qt.Horizontal)
        self.sldrGrip1.setObjectName(_fromUtf8("sldrGrip1"))
        self.G1LableS = QtGui.QLabel(self.SliderFrame)
        self.G1LableS.setGeometry(QtCore.QRect(7, 171, 50, 17)) #24, 171, 41, 17
        self.G1LableS.setObjectName(_fromUtf8("G1LableS"))
        self.rdoutGrip1 = QtGui.QLabel(self.SliderFrame)
        self.rdoutGrip1.setGeometry(QtCore.QRect(215, 166, 49, 28))
        self.rdoutGrip1.setObjectName(_fromUtf8("rdoutGrip1"))
        self.sldrMaxTorque = QtGui.QSlider(self.SliderFrame)
        self.sldrMaxTorque.setGeometry(QtCore.QRect(530, 40, 30, 115))
        self.sldrMaxTorque.setMaximum(100)
        self.sldrMaxTorque.setProperty("value", 25)
        self.sldrMaxTorque.setOrientation(QtCore.Qt.Vertical)
        self.sldrMaxTorque.setObjectName(_fromUtf8("sldrMaxTorque"))
        self.rdoutTorq = QtGui.QLabel(self.SliderFrame)
        self.rdoutTorq.setGeometry(QtCore.QRect(534, 162, 50, 28))
        self.rdoutTorq.setObjectName(_fromUtf8("rdoutTorq"))
        self.sldrSpeed = QtGui.QSlider(self.SliderFrame)
        self.sldrSpeed.setGeometry(QtCore.QRect(600, 40, 29, 115))
        self.sldrSpeed.setMaximum(100)
        self.sldrSpeed.setProperty("value", 25)
        self.sldrSpeed.setSliderPosition(25)
        self.sldrSpeed.setOrientation(QtCore.Qt.Vertical)
        self.sldrSpeed.setObjectName(_fromUtf8("sldrSpeed"))
        self.TqLabel = QtGui.QLabel(self.SliderFrame)
        self.TqLabel.setGeometry(QtCore.QRect(520, 10, 52, 20))
        self.TqLabel.setObjectName(_fromUtf8("TqLabel"))
        self.rdoutSpeed = QtGui.QLabel(self.SliderFrame)
        self.rdoutSpeed.setGeometry(QtCore.QRect(604, 162, 49, 28))
        self.rdoutSpeed.setObjectName(_fromUtf8("rdoutSpeed"))
        self.SpLabel = QtGui.QLabel(self.SliderFrame)
        self.SpLabel.setGeometry(QtCore.QRect(590, 10, 41, 21))
        self.SpLabel.setObjectName(_fromUtf8("SpLabel"))
        self.chk_directcontrol = QtGui.QCheckBox(self.centralwidget)
        self.chk_directcontrol.setGeometry(QtCore.QRect(750, 570, 131, 22))
        self.chk_directcontrol.setChecked(False)
        self.chk_directcontrol.setObjectName(_fromUtf8("chk_directcontrol"))
        self.rdoutMousePixels = QtGui.QLabel(self.centralwidget)
        self.rdoutMousePixels.setGeometry(QtCore.QRect(429, 530, 131, 20))
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Ubuntu Mono"))
        font.setPointSize(12)
        font.setBold(True)
        font.setWeight(75)
        self.rdoutMousePixels.setFont(font)
        self.rdoutMousePixels.setTextFormat(QtCore.Qt.AutoText)
        self.rdoutMousePixels.setObjectName(_fromUtf8("rdoutMousePixels"))
        self.rdoutRGB = QtGui.QLabel(self.centralwidget)
        self.rdoutRGB.setGeometry(QtCore.QRect(757, 530, 121, 20))
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Ubuntu Mono"))
        font.setPointSize(12)
        font.setBold(True)
        font.setWeight(75)
        self.rdoutRGB.setFont(font)
        self.rdoutRGB.setTextFormat(QtCore.Qt.AutoText)
        self.rdoutRGB.setObjectName(_fromUtf8("rdoutRGB"))
        self.RGBValueLabel = QtGui.QLabel(self.centralwidget)
        self.RGBValueLabel.setGeometry(QtCore.QRect(570, 530, 180, 17))
        font = QtGui.QFont()
        font.setBold(True)
        font.setWeight(75)
        self.RGBValueLabel.setFont(font)
        self.RGBValueLabel.setObjectName(_fromUtf8("RGBValueLabel"))
        self.PixelCoordLabel = QtGui.QLabel(self.centralwidget)
        self.PixelCoordLabel.setGeometry(QtCore.QRect(268, 530, 144, 17))
        font = QtGui.QFont()
        font.setBold(True)
        font.setWeight(75)
        self.PixelCoordLabel.setFont(font)
        self.PixelCoordLabel.setObjectName(_fromUtf8("PixelCoordLabel"))
        self.btn_task1 = QtGui.QPushButton(self.centralwidget)
        self.btn_task1.setGeometry(QtCore.QRect(900, 200, 311, 71))
        font = QtGui.QFont()
        font.setPointSize(20)
        font.setBold(True)
        font.setWeight(75)
        self.btn_task1.setFont(font)
        self.btn_task1.setObjectName(_fromUtf8("btn_task1"))
        self.btn_task2 = QtGui.QPushButton(self.centralwidget)
        self.btn_task2.setGeometry(QtCore.QRect(900, 280, 311, 71))
        font = QtGui.QFont()
        font.setPointSize(20)
        font.setBold(True)
        font.setWeight(75)
        self.btn_task2.setFont(font)
        self.btn_task2.setObjectName(_fromUtf8("btn_task2"))
        self.btn_task3 = QtGui.QPushButton(self.centralwidget)
        self.btn_task3.setGeometry(QtCore.QRect(900, 360, 311, 71))
        font = QtGui.QFont()
        font.setPointSize(20)
        font.setBold(True)
        font.setWeight(75)
        self.btn_task3.setFont(font)
        self.btn_task3.setObjectName(_fromUtf8("btn_task3"))
        self.btn_task4 = QtGui.QPushButton(self.centralwidget)
        self.btn_task4.setGeometry(QtCore.QRect(900, 440, 311, 71))
        font = QtGui.QFont()
        font.setPointSize(20)
        font.setBold(True)
        font.setWeight(75)
        self.btn_task4.setFont(font)
        self.btn_task4.setObjectName(_fromUtf8("btn_task4"))
        self.btn_exec_6 = QtGui.QPushButton(self.centralwidget)
        self.btn_exec_6.setGeometry(QtCore.QRect(900, 520, 311, 71))
        font = QtGui.QFont()
        font.setPointSize(20)
        font.setBold(True)
        font.setWeight(75)
        self.btn_exec_6.setFont(font)
        self.btn_exec_6.setObjectName(_fromUtf8("btn_exec_6"))
        self.layoutWidget_8 = QtGui.QWidget(self.centralwidget)
        self.layoutWidget_8.setGeometry(QtCore.QRect(10, 360, 221, 410))
        self.layoutWidget_8.setObjectName(_fromUtf8("layoutWidget_8"))
        self.Group2 = QtGui.QVBoxLayout(self.layoutWidget_8)
        self.Group2.setMargin(10)
        self.Group2.setObjectName(_fromUtf8("Group2"))
        self.btnUser1 = QtGui.QPushButton(self.layoutWidget_8)
        self.btnUser1.setObjectName(_fromUtf8("btnUser1"))
        self.Group2.addWidget(self.btnUser1)
        self.btnUser2 = QtGui.QPushButton(self.layoutWidget_8)
        self.btnUser2.setObjectName(_fromUtf8("btnUser2"))
        self.Group2.addWidget(self.btnUser2)
        self.btnUser3 = QtGui.QPushButton(self.layoutWidget_8)
        self.btnUser3.setObjectName(_fromUtf8("btnUser3"))
        self.Group2.addWidget(self.btnUser3)
        self.btnUser4 = QtGui.QPushButton(self.layoutWidget_8)
        self.btnUser4.setObjectName(_fromUtf8("btnUser4"))
        self.Group2.addWidget(self.btnUser4)
        self.btnUser5 = QtGui.QPushButton(self.layoutWidget_8)
        self.btnUser5.setObjectName(_fromUtf8("btnUser5"))
        self.Group2.addWidget(self.btnUser5)
        self.btnUser6 = QtGui.QPushButton(self.layoutWidget_8)
        self.btnUser6.setObjectName(_fromUtf8("btnUser6"))
        self.Group2.addWidget(self.btnUser6)
        self.btnUser7 = QtGui.QPushButton(self.layoutWidget_8)
        self.btnUser7.setObjectName(_fromUtf8("btnUser7"))
        self.Group2.addWidget(self.btnUser7)
        self.btnUser8 = QtGui.QPushButton(self.layoutWidget_8)
        self.btnUser8.setObjectName(_fromUtf8("btnUser8"))
        self.Group2.addWidget(self.btnUser8)
        self.btnUser9 = QtGui.QPushButton(self.layoutWidget_8)
        self.btnUser9.setObjectName(_fromUtf8("btnUser9"))
        self.Group2.addWidget(self.btnUser9)
        self.btnUser10 = QtGui.QPushButton(self.layoutWidget_8)
        self.btnUser10.setAutoRepeatDelay(300)
        self.btnUser10.setObjectName(_fromUtf8("btnUser10"))
        self.Group2.addWidget(self.btnUser10)
        self.btnUser11 = QtGui.QPushButton(self.layoutWidget_8)
        self.btnUser11.setAutoRepeatDelay(300)
        self.btnUser11.setObjectName(_fromUtf8("btnUser11"))
        self.Group2.addWidget(self.btnUser11)
        self.btnUser12 = QtGui.QPushButton(self.layoutWidget_8)
        self.btnUser12.setAutoRepeatDelay(300)
        self.btnUser12.setObjectName(_fromUtf8("btnUser12"))
        self.Group2.addWidget(self.btnUser12)
        self.groupBox = QtGui.QGroupBox(self.centralwidget)
        self.groupBox.setGeometry(QtCore.QRect(10, 820, 1211, 51))
        self.groupBox.setObjectName(_fromUtf8("groupBox"))
        self.rdoutStatus = QtGui.QLabel(self.groupBox)
        self.rdoutStatus.setGeometry(QtCore.QRect(70, 0, 905, 51))
        font = QtGui.QFont()
        font.setPointSize(12)
        self.rdoutStatus.setFont(font)
        self.rdoutStatus.setTextFormat(QtCore.Qt.AutoText)
        self.rdoutStatus.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
        self.rdoutStatus.setObjectName(_fromUtf8("rdoutStatus"))
        MainWindow.setCentralWidget(self.centralwidget)
        self.statusbar = QtGui.QStatusBar(MainWindow)
        self.statusbar.setObjectName(_fromUtf8("statusbar"))
        MainWindow.setStatusBar(self.statusbar)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)
예제 #58
0
def main():
    app = QtGui.QApplication(sys.argv)
    dialog = TestDialog()
    #myqq.setWindowTitle("My Table")
    dialog.show()
    sys.exit(app.exec_())
예제 #59
0
 def getDefaultIcon():
     return QtGui.QIcon(os.path.dirname(__file__) + "/../images/alg.png")
예제 #60
0
파일: Detector.py 프로젝트: yue123161/botd
    def initUI(self):
        self.setGeometry(10, 10, 1000, 900)
        self.setWindowTitle('Botnet detector')
        self.setWindowIcon(QtGui.QIcon('../etc/favicon.png'))

        # Statusbar
        self.statusbar = QtGui.QStatusBar()
        self.statusbar.setSizeGripEnabled(False)
        self.statusbar.showMessage("Initializing...")
        self.permstatuslabel = QtGui.QLabel("Initializing...")
        self.statusbar.addPermanentWidget(self.permstatuslabel)

        # Text labels
        l1 = QtGui.QLabel("Model")
        l2 = QtGui.QLabel("Network hosts")

        # Dropdown menus
        self.models_dropdown = QtGui.QComboBox(self)
        self.models_dropdown.setMinimumContentsLength(15)
        self.models_dropdown.setSizeAdjustPolicy(
            QtGui.QComboBox.AdjustToContents)
        self.models_dropdown.activated[str].connect(self.change_models)

        self.hosts_dropdown = QtGui.QComboBox(self)
        self.hosts_dropdown.setMinimumContentsLength(15)
        self.hosts_dropdown.setSizeAdjustPolicy(
            QtGui.QComboBox.AdjustToContents)
        self.hosts_dropdown.activated[str].connect(self.change_hosts)

        # Plot widget
        self.plotwidget = pg.PlotWidget()
        self.plotwidget.setLimits(xMin=0, yMin=0)

        # Table
        self.table = QtGui.QTableWidget()
        self.table.setColumnCount(2)
        self.table.setHorizontalHeaderLabels(
            QtCore.QString("host;score;").split(";"))
        self.table.horizontalHeader().setResizeMode(0,
                                                    QtGui.QHeaderView.Stretch)
        self.table.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers)
        self.table.setDragDropOverwriteMode(False)
        self.table.setDragDropMode(QtGui.QAbstractItemView.NoDragDrop)
        self.table.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection)
        self.table.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows)

        # Set layout
        self.hbox = QtGui.QHBoxLayout()
        self.vbox = QtGui.QVBoxLayout()

        self.vbox.addWidget(l1)
        self.vbox.addWidget(self.models_dropdown)
        self.vbox.addStretch(1)
        self.vbox.addWidget(l2)
        self.vbox.addWidget(self.hosts_dropdown)
        self.vbox.addStretch(2)

        self.hbox.addWidget(self.plotwidget)
        self.hbox.addLayout(self.vbox)

        self.vbox2 = QtGui.QVBoxLayout()
        self.vbox2.addLayout(self.hbox, 3)
        self.vbox2.addWidget(self.table, 2)

        self.vbox2.addStretch()
        self.vbox2.addWidget(self.statusbar)

        self.setLayout(self.vbox2)

        self.center()
        self.show()